package com.yanqu.road.server.manger;

import com.yanqu.road.entity.activity.CardPrivilege;
import com.yanqu.road.entity.beautyescort.EscortBeautyCartNPCInfo;
import com.yanqu.road.entity.beautyescort.EscortDartTypeInfo;
import com.yanqu.road.entity.beautyescort.rank.EscortWeekRewardInfo;
import com.yanqu.road.entity.child.ChildGrowStageAddition;
import com.yanqu.road.entity.config.goods.MammonSkill;
import com.yanqu.road.entity.config.hunt.HuntBoxReward;
import com.yanqu.road.entity.config.system.ChatLimit;
import com.yanqu.road.entity.enums.eCardType;
import com.yanqu.road.entity.enums.eMonopolyMarketResType;
import com.yanqu.road.entity.enums.eSpecialServerType;
import com.yanqu.road.entity.enums.eUnionPosition;
import com.yanqu.road.entity.hunt.HuntTimeData;
import com.yanqu.road.entity.inn.InnScore;
import com.yanqu.road.entity.marriage.MarriageConsume;
import com.yanqu.road.entity.monopolymarket.MonopolyMarketConsume;
import com.yanqu.road.entity.monopolymarket.fortress.MonopolyMarketFortressRankReward;
import com.yanqu.road.entity.rank.cross.RankGradeInfo;
import com.yanqu.road.entity.servercenter.ServerInfo;
import com.yanqu.road.entity.sacrifice.SacrificeDamageRankReward;
import com.yanqu.road.entity.sacrifice.SacrificeTimeData;
import com.yanqu.road.entity.tradewar.CrossTradeWarNoticeKillPatronsConfig;
import com.yanqu.road.entity.travel.BrothelInteractiveType;
import com.yanqu.road.entity.travel.CasinoInteractiveType;
import com.yanqu.road.entity.travel.DrinkInteractiveType;
import com.yanqu.road.entity.travel.TravelDefaultEvent;
import com.yanqu.road.entity.union.cross.CrossUnionJoinExInfo;
import com.yanqu.road.entity.winery.WineryDrunkFriendlyConfig;
import com.yanqu.road.entity.wingroom.config.WingRoomRegionConfig;
import com.yanqu.road.entity.wingroom.config.regioncoords.BaseRegionCoords;
import com.yanqu.road.entity.wingroom.config.regioncoords.RegionCoordsBuilder;
import com.yanqu.road.logic.bussiness.servercenter.ServerBussiness;
import com.yanqu.road.logic.config.ConfigPropertyAnnotation;
import com.yanqu.road.logic.config.GameConfig;
import com.yanqu.road.logic.config.beautyescort.BeautyEscortConfig;
import com.yanqu.road.logic.config.unioncampwar.UnionCampWarConfig;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.manger.plugin.ManagerReloadListener;
import com.yanqu.road.utils.ConfigHelper;
import com.yanqu.road.utils.RandomHelper;
import com.yanqu.road.utils.date.DateHelper;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;
import com.yanqu.road.utils.string.StringUtils;

import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class ConfigMgr extends TempMgr {

    private static List<ManagerReloadListener> managerReloadListenerList = new ArrayList<>();

    private static RandomHelper threadRandom = new RandomHelper();
    //门客
    /**
     * 门客升级消耗阅历各个品质千分比
     */
    private static List<Integer> patronsUpgradeCostList = new ArrayList<>();
    /**
     * 门客实力参数1
     */
    private static int patronsAbilityParam1;
    /**
     * 门客实力参数2
     */
    private static int patronsAbilityParam2;
    /**
     * 门客实力参数3
     */
    private static int patronsAbilityParam3;
    /**
     * 门客实力参数4
     */
    private static int patronsAbilityParam4;
    /**
     * 门客实力参数5
     */
    private static int patronsAbilityParam5;

    //座骑
    /**
     * 座骑技能普通改装参数1
     */
    private static List<Integer> vehicleSkillNormalModifyParamList;
    /**
     * 座骑技能定制改装参数1
     */
    private static List<Integer> vehicleSkillCustomModifyParamList;
    /**
     * 座骑技能改装消耗银两参数1
     */
    private static int vehicleSkillModifySilverCostParam1;
    /**
     * 座骑技能改装消耗银两参数2
     */
    private static int vehicleSkillModifySilverCostParam2;
    /**
     * 座骑技能改装消耗银两参数3
     */
    private static int vehicleSkillModifySilverCostParam3;
    /**
     * 座骑技能改装消耗银两参数4
     */
    private static int vehicleSkillModifySilverCostParam4;
    /**
     * 座骑技能改装参数1
     */
    private static int vehicleSkillModifyParam1;
    /**
     * 座骑技能改装参数2
     */
    private static int vehicleSkillModifyParam2;

    //商战
    /**
     * 商战买buff参数1
     */
    private static int tradeWarBuyBuffCostParam1;
    /**
     * 商战买buff参数2
     */
    private static int tradeWarBuyBuffCostParam2;
    /**
     * 跨服商战买buff参数1
     */
    private static int crossTradeWarBuyBuffCostParam1;
    /**
     * 跨服商战买buff参数2
     */
    private static int crossTradeWarBuyBuffCostParam2;
    /**
     * 商战奖励参数1
     */
    private static int tradeWarRewardParam1;
    /**
     * 商战奖励参数2
     */
    private static int tradeWarRewardParam2;
    /**
     * 商战奖励参数3
     */
    private static int tradeWarRewardParam3;
    /**
     * 跨服商战奖励参数1
     */
    private static int crossTradeWarRewardParam1;
    /**
     * 跨服商战奖励参数2
     */
    private static int crossTradeWarRewardParam2;
    /**
     * 跨服商战奖励参数3
     */
    private static int crossTradeWarRewardParam3;
    /**
     * 跨服商战上公告需要击败多少门客
     */
    private static List<CrossTradeWarNoticeKillPatronsConfig> crossTradeWarNoticeNeedKillPatronsCountList;

    //美女
    /**
     * 美女增加经验参数1
     */
    private static int beautyAddExpParam1;
    /**
     * 美女增加经验参数2
     */
    private static int beautyAddExpParam2;
    /**
     * 美女增加经验参数1
     */
    private static int beautyAddExpParam3;
    /**
     * 美女传唤产子参数1
     */
    private static int beautyTrystMakeChildParam1;
    /**
     * 美女传唤产子参数2
     */
    private static int beautyTrystMakeChildParam2;
    /**
     * 美女传唤产子参数3
     */
    private static int beautyTrystMakeChildParam3;
    /**
     * 美女传唤产子参数4
     */
    private static int beautyTrystMakeChildParam4;
    /**
     * 美女传唤产子参数5
     */
    private static int beautyTrystMakeChildParam5;
    /**
     * 美女传唤产子参数6
     */
    private static int beautyTrystMakeChildParam6;
    /**
     * 美女技能普通改装参数1
     */
    private static List<Integer> beautySkillNormalModifyParamList;
    /**
     * 美女技能定制改装参数1
     */
    private static List<Integer> beautySkillCustomModifyParamList;
    /**
     * 美女技能改装消耗银两参数1
     */
    private static int beautySkillModifySilverCostParam1;
    /**
     * 美女技能改装消耗银两参数2
     */
    private static int beautySkillModifySilverCostParam2;
    /**
     * 美女技能改装消耗银两参数3
     */
    private static int beautySkillModifySilverCostParam3;
    /**
     * 美女技能改装消耗银两参数4
     */
    private static int beautySkillModifySilverCostParam4;

    /**
     * 美女宠幸灯谜答题奖励 魅力值
     */
    private static int beautyTravelGuessSuccessReward;
    private static int beautyTravelGuessFailReward;

    /**
     * 美女宠幸吟诗答题奖励 魅力值
     */
    private static int beautyTravelPoetrySuccessReward;
    private static int beautyTravelPoetryFailReward;

    //子嗣
    /**
     * 子嗣拓展席位消耗
     */
    private static List<Integer> childSiteCountUnlockParamList;
    /**
     * 子嗣成年
     */
    private static List<Integer> childAdultRewardItemIdList;
    /**
     * 前几次子嗣职业列表
     */
    private static List<Integer> childRandomOccupationList;
    /**
     * 子嗣孤独终老衰减系数1、2
     */
    private static int childLonelyEarnSpeedTitleEffect1;
    private static int childLonelyEarnSpeedTitleEffect2;
    /**
     * 子嗣成长阶段加成
     */
    private static List<ChildGrowStageAddition> childGrowStageAdditionList;

    //任务
    /**
     * 任务日常活跃度档次
     */
    private static List<Integer> taskDailyActiveList = new ArrayList<>();
    /**
     * 任务日常活跃度档次
     */
    private static List<Property> taskDailyActiveRewardList = new ArrayList<>();
    /**
     * 7日活动活跃度档次
     */
    private static List<Integer> sevenDayActiveList = new ArrayList<>();
    /**
     * 7日活动活跃度档次
     */
    private static List<Property> sevenDayActiveRewardList = new ArrayList<>();
    /**
     * 7日限购商品
     */
    private static List<Integer> sevenDayLimitMallIdList = new ArrayList<>();
    /**
     * 签到奖励
     */
    private static Map<Integer, Property> signRewardMap = new ConcurrentHashMap<>();

    //矿战
    /**
     * 矿场开启需要身份
     */
    private static Map<Integer, Integer> mineOpenNeedTitleMap = new ConcurrentHashMap<>();
    /**
     * 矿场产出资源道具编号
     */
    private static Map<Integer, Integer> mineOutputItemMap = new ConcurrentHashMap<>();
    /**
     * 矿场避难所产出加成
     */
    private static List<Integer> mineRefugeOutputAdditionList = new ArrayList<>();

    //膜拜
    /**
     * 膜拜随机元宝奖励参数1
     */
    private static int worshipRewardParam1;
    /**
     * 膜拜随机元宝奖励参数2
     */
    private static int worshipRewardParam2;

    //关卡
    /**
     * 关卡买buff参数1
     */
    private static List<Integer> passSilverBuyBuffCostList = new ArrayList<>();

    //特权卡
    private static Map<Integer, CardPrivilege> cardPrivilegeMap = new ConcurrentHashMap<>();

    //转盘
    /**
     * 转盘抽奖概率列表
     */
    private static List<Integer> turntableLotteryPossibleList;

    //乔迁风云
    /**
     * 膜拜参数1
     */
    private static int estateWarWorshipRewardParam1;
    /**
     * 膜拜参数2
     */
    private static int estateWarWorshipRewardParam2;
    /**
     * 膜拜参数3
     */
    private static int estateWarWorshipRewardParam3;
    /**
     * 府邸皮肤原皮
     */
    private static List<Integer> estateSkinList = new ArrayList<>();

    //联盟
    private static List<Integer> unionFlagList = new ArrayList<>();
    /**
     * 联盟建设活跃度档次
     */
    private static List<Integer> unionConstructActiveList = new ArrayList<>();
    /**
     * 联盟建设活跃度档次奖励
     */
    private static List<Property> unionConstructActiveRewardList = new ArrayList<>();
    /**
     * 职位需要贡献
     */
    private static Map<Integer, Long> positionNeedContributionMap;

    //财神庙
    private static Map<Integer, MammonSkill> mammonSkillMap;

    //狩猎
    private static HuntTimeData huntTimeData;
    private static List<HuntBoxReward> huntBoxRewardList;

    //祭天
    private static SacrificeTimeData sacrificeTimeData;
    private static List<Integer> sacrificeAttackRewardParam;
    private static List<Integer> sacrificeBossLevelParam;
    private static List<SacrificeDamageRankReward> sacrificeDamageRankRewardList;
    private static int sacrificeDamageMaxRank;

    //需要映射定位城市
    private static List<String> needTranslateLocationCity = new ArrayList<>();
    private static List<String> randomLocationCity = new ArrayList<>();
    private static List<String> noTranslateCity = new ArrayList<>();

    //游历
    private static List<TravelDefaultEvent> travelDefaultEventList = new ArrayList<>();
    private static int travelMultiTimes;
    private static int travelMultiNeedTitle;
    private static List<Integer> brothelBeautyList = new ArrayList<>();
    private static Map<Integer, BrothelInteractiveType> brothelInteractiveTypeMap = new ConcurrentHashMap<>();
    /**
     * 免费的青楼互动类型（小助理用到）
     */
    private static int brothelFreeType ;
    private static Map<Integer, CasinoInteractiveType> casinoInteractiveTypeMap = new ConcurrentHashMap<>();
    /**
     * 奖励最好的赌坊互动类型（选项 小助理用到）
     */
    private static int bestRewardCasinoInteractiveType;

    private static List<DrinkInteractiveType> drinkInteractiveTypeList = new ArrayList<>();
    private static int drinkInteractiveTotalWeight;

    //皮肤商店
    private static int skinMallPatronsNum;
    private static int skinMallBeautyNum;
    private static int skinMallAssistantNum;
    //小助理皮肤商店刷新周期天数
    private static int skinMallAssistantUpdateDays;

    //客栈热门菜系配置     周几           菜系     加成系数 千分
    private static Map<Integer, Map<Integer, Integer>> hootDishesTypeMap;
    //客栈菜系职业对应关系
    private static Map<Integer, List<Integer>> dishesOccupationMap;

    //菜品品质基础分数
    private static List<Integer> dishesQualityScoreList;

    //菜品等级影响分数参数
    private static int dishesLevelScoreParam1;

    private static int dishesLevelScoreParam2;

    private static int dishesLevelScoreParam3;

    //菜品评分加成map
    private static List<InnScore> dishesScoreList;

    //菜品分数随机区间1
    private static int dishesScoreRandomParam1;
    //菜品分数随机区间2
    private static int dishesScoreRandomParam2;

    //招商技能ID
    private static List<Integer> zsSkillList;

    private static List<Integer> zsProjectOpenTime;
    /**
     * 联姻消耗配置
     */
    private static List<MarriageConsume> marriageConsumeList = new ArrayList<>();

    //招商项目开放限制
    private static List<Integer> zsProjectOpenMultiple;

    //关卡的头衔对应可以存的时间数目
    private static Map<Integer,Integer> passRoadEventNum = new ConcurrentHashMap<>();


    /**
     * 榷场
     * */
    //榷署开放时间（开始秒|结束秒）（起点为周一首秒）
    private static int officeOpenSecond;
    private static int officeEndSecond;
    // 辽国王帐可采集时间段（开始秒|结束秒）（起点为周一首秒）
    private static int resGrabKingOpenSecond;
    private static int resGrabKingEndSecond;
    // 西夏王宫可采集时间段
    private static int resGrabQueenOpenSecond;
    private static int resGrabQueenEndSecond ;
    // 边关要塞 派遣期
    private static int fortressDispatchPeriodOpenSecond;
    private static int fortressDispatchPeriodEndSecond;
    // 边关要塞 结算期
    private static int fortressSettlementPeriodOpenSecond;
    private static int fortressSettlementPeriodEndSecond;
    // 边关要塞 采集期
    private static int fortressCollectingPeriodOpenSecond;
    private static int fortressCollectingPeriodEndSecond;
    // 边关要塞 休息期
    private static int fortressRestPeriodOpenSecond;
    private static int fortressRestPeriodEndSecond;
    // 抢占榷署元宝消耗（初始值|递增值|最大值）
    private static MonopolyMarketConsume officeConsume;
    // 资源争夺战 鼓舞消耗  k:type
    private static Map<Integer,MonopolyMarketConsume> resGrabConsumeMap = new HashMap<>();
    // 边关要塞 每个要塞的奖励 k:梯队id
    private static Map<Integer,List<MonopolyMarketFortressRankReward>> fortressRankRewardMap = new HashMap<>();

    // 王宫每日开启时间
    private static int kingDailyOpenTime;
    private static int kingDailyEndTime;

    // 王帐每日开启时间
    private static int queenDailyOpenTime;
    private static int queenDailyEndTime;


    /**
     * 新榷场start
     *
     * */
    //榷署开放时间（开始秒|结束秒）（起点为周一首秒）
    private static int officeOpenSecondNew;
    private static int officeEndSecondNew;
    // 辽国王帐可采集时间段（开始秒|结束秒）（起点为周一首秒）
    private static int resGrabKingOpenSecondNew;
    private static int resGrabKingEndSecondNew;
    // 西夏王宫可采集时间段
    private static int resGrabQueenOpenSecondNew;
    private static int resGrabQueenEndSecondNew ;

    // 王宫每日开启时间
    private static int kingDailyOpenTimeNew;
    private static int kingDailyEndTimeNew;

    // 王帐每日开启时间
    private static int queenDailyOpenTimeNew;
    private static int queenDailyEndTimeNew;

    // 榜单领奖期间
    private static int newMonopolyOpenRankTime;
    private static int newMonopolyEndRankTime;

    //地图配置
    //榷场资源点地图放大系数
    private static int newMonopolyMapSize;
    //榷场地图循环基础底值
    private static int newMonopolyMapBase;
    //榷场地图循环每次递增
    private static int newMonopolyMapAdd;
    //榷场地图循环次数
    private static int newMonopolyMapRound;
    //榷场地图中心值
    private static int newMonopolyMapMidValue;

    // 抢占榷署元宝消耗（初始值|递增值|最大值）
    private static MonopolyMarketConsume officeConsumeNew;
    // 新榷场end


    //孙子
    private static List<Integer> grandChildProfessionSkillList = new ArrayList<>();
    private static List<Integer> grandChildOccupationList = new ArrayList<>();

    //厢房
    private static int shareEventRefreshBaseWeight; //呼朋唤友刷新初始权重
    private static int shareEventRefreshAddWeight;  //呼朋唤友刷新累加权重
    private static int shareEventRefreshMaxWeight;  //呼朋唤友刷新权重上限
    private static Map<Integer, WingRoomRegionConfig> regionConfigMap = new HashMap<>(); //厢房区域配置
    private static Map<Integer, Integer> suitSkillMap = new HashMap<>();

    // 药铺
    private static List<Integer> drugHardCaseWeight = new ArrayList<>();
    private static int drugHardCaseTotalWeightValue;
    /**
     * 药铺疑难杂症奖励（差奖励|中等奖励|好奖励）
     */
    private static List<Integer> drugHardCaseRewardList = new ArrayList<>();
    /**
     * 药铺疑难杂症评价对应奖励档位（一命呜呼|奄奄一息|病情加重|稍见好转|大有起色|妙手回春)）
     */
    private static List<Integer> drugHardCaseTimesList = new ArrayList<>();
    /**
     * 药铺疑难杂症治疗结束健康值评价区间(一命呜呼|奄奄一息|额外判断区间|妙手回春)
     */
    private static List<Integer[]> healthEvaluationList = new ArrayList<>();

    /**
     * 药铺疑难杂症评价对应buff效果（增加铜币千分比）
     */
    private static List<Integer> drugHardCaseBuffValueList = new ArrayList<>();

    //系统预告
    private static Map<Integer, Property> systemPreviewRewardMap = new ConcurrentHashMap<>();

    private static Map<Integer, Property> wineryFriendlyRewardMap;

    private static int wineryDispatchCoolDownTimeHour;

    private static List<WineryDrunkFriendlyConfig> wineryDrunkFriendlyConfigs;
    private static Map<Integer, List<Integer>> wineryDispatchStaffSkillListMap;

    private static List<List<Integer>> wineryProcessProbabilityFormula;

    private static List<List<Integer>> wineryProcessWeightFormula1List;

    private static int wineryProcessWeightsFormula2;

    private static Property wineryInitItemReward;

    private static List<List<Integer>> wineryAbilityFormulaList;

    private static int wineryDispatchSkillUpgrade;

    private static List<ChatLimit> localChatLimitList = new ArrayList<>();
    private static List<ChatLimit> crossChatLimitList = new ArrayList<>();
    private static List<Integer> tradeWarTrackTimesByVipList = new ArrayList<>();

    //押镖
    /**
     * 镖车机器人
     */
    private static Map<Integer, EscortBeautyCartNPCInfo> cartNPCInfoMap = new ConcurrentHashMap<>();
    /**
     * 机器人
     */
    private static EscortDartTypeInfo robotDartCartType;
    /**
     * 每日走镖开放起始时间（分钟）
     */
    private static int ESCORTING_START_MINUTE = 480;
    /**
     * 每日走镖开放终止时间（分钟）
     */
    private static int ESCORTING_END_MINUTE = 1320;
    /**
     * 押镖劫镖损失(千分比);劫镖损失次数上限
     */
    private static List<Integer> robberLoss;
    /**
     * 最大被劫次数（有损失）
     */
    private static int MAX_ROB_TIMES_IN_LOSS = 4;
    /**
     * 押镖事件概率(概率随机节点|初始概率(千分比)|增加概率(千分比))
     */
    private static List<Integer> ESCORT_EVENT_PROBABILITY;
    /**
     * 镖车类型-等级
     */
    private static Map<Integer, EscortDartTypeInfo> dartTypeInfoMap;

    private static List<Integer> fightBuyConsume;
    /**
     * 押镖次数购买消耗
     */
    private static List<Integer> escortBuyConsume;
    /**
     * 普通奖励
     */
    static List<EscortWeekRewardInfo> rankRewardList = new ArrayList<>();
    /**
     * 会长奖励
     */
    private static List<EscortWeekRewardInfo> rankChairRewardList = new ArrayList<>();
    /**
     * 普通奖励(跨服分组)
     */
    private static List<EscortWeekRewardInfo> rankCrossRewardList = new ArrayList<>();
    /**
     * 会长奖励(跨服分组)
     */
    static List<EscortWeekRewardInfo> rankCrossChairRewardList = new ArrayList<>();

    private static int weekCardExperimentTimes;         //周卡试用次数
    private static int weekCardExperimentDay;           //周卡试用天数

    /**
     * 玩家实力榜配置
     */
    static List<RankGradeInfo> monthAbilityRankGradeConfigs = new ArrayList<>();

    /**
     * 跨服商会额外加入限制
     */
    static CrossUnionJoinExInfo crossUnionJoinExConfig = null;

    /**
     * 商帮之争配置
     */
    static UnionCampWarConfig unionCampWarConfig = null;

    /**
     * 门客信物: 信物等级，绑定數量
     */
    static Map<Integer, Integer> sakeLvToNumMap;

    /**
     * 门客信物: 信物等级，解锁的技能
     */
    static Map<Integer, Integer> sakeLvToUnlockSkillMap;

    /**
     * 门客信物：伴生等级上限依赖
     */
    static Map<Integer, Map<Integer, Integer>> sakeCompanionParamMap;

    /**
     * Linlee茶联动
     */
    private static int linLeeSkinReplaceType;
    private static int linLeeSkinReplaceId;

    @Override
    public boolean init() {
        return reloadGameConfig();
    }

    @Override
    public boolean stop() {
        return false;
    }

    @Override
    public boolean reloadConfig() {
        GameConfig.reloadGameGlobalConfig();
        reloadGameConfig();
        notifyReload();
        return true;
    }

    public void handle20ConfigReplace() {
        //是否2.0替换
        ServerInfo serverInfo;
        long serverId = ConfigHelper.getLong("serverId");
        if(ServerListMgr.getServerList() != null){
            serverInfo = ServerListMgr.getServerInfo(serverId);
        }else {
            serverInfo = ServerBussiness.getServerInfoByServerId(serverId);
        }
        if(serverInfo != null && serverInfo.getSpecialServer() == eSpecialServerType.ZhenHuan.getValue()){
            getLogger().info("开始处理甄嬛2.0特殊配置");
            Field[] fields = GameConfig.class.getFields();
            Map<String, Object> replaceMap = new HashMap<>();
            for (Field field : fields) {
                ConfigPropertyAnnotation annotation = field.getAnnotation(ConfigPropertyAnnotation.class);
                if (annotation != null){
                    String key = annotation.key();
                    if(key.startsWith("HH_")){
                        String replaceKey = key.substring(3);
                        try {
                            Object replaceValue = field.get(null);
                            replaceMap.put(replaceKey, replaceValue);
                        } catch (Exception e) {
                            getLogger().error("甄嬛2.0特殊配置 fail to get key {}'s value,error:{}", replaceKey, e);
                        }
                    }
                }
            }
            for (Field field : fields) {
                ConfigPropertyAnnotation annotation = field.getAnnotation(ConfigPropertyAnnotation.class);
                if (annotation != null && replaceMap.containsKey(annotation.key())) {
                    try {
                        Object olaValue = field.get(null);
                        field.set(null, replaceMap.get(annotation.key()));
                        getLogger().info("甄嬛2.0特殊配置[{}], 旧值：{} 新值：{}", annotation.key(), olaValue, replaceMap.get(annotation.key()));
                    } catch (Exception e) {
                        getLogger().error("甄嬛2.0特殊配置 fail to replace:{},error:{}", annotation.key(), e);
                    }
                }
            }
        }else {
            getLogger().info("非甄嬛2.0");
        }
    }

    @Override
    public boolean reloadData() throws Exception {
        return true;
    }

    public static void addReloadListener(ManagerReloadListener reloadListener){
        managerReloadListenerList.add(reloadListener);
    }

    private static void notifyReload(){
        if(null != managerReloadListenerList && !managerReloadListenerList.isEmpty()){
            for (ManagerReloadListener reloadListener : managerReloadListenerList) {
                reloadListener.notifyReload();
            }
        }
    }

    private boolean reloadGameConfig(){
        //门客
        patronsUpgradeCostList = StringUtils.stringToIntegerList(GameConfig.PATRONS_UPDATE_RATIO_LIST, "\\|");
        String[] configParam = GameConfig.PATRONS_ABILITY_PARAM.split("\\|");
        patronsAbilityParam1 = Integer.parseInt(configParam[0]);
        patronsAbilityParam2 = Integer.parseInt(configParam[1]);
        patronsAbilityParam3 = Integer.parseInt(configParam[2]);
        patronsAbilityParam4 = Integer.parseInt(configParam[3]);
        patronsAbilityParam5 = Integer.parseInt(configParam[4]);

        //座骑
        vehicleSkillNormalModifyParamList = StringUtils.stringToIntegerList(GameConfig.VEHICLE_SKILL_NORMAL_MODIFY_PARAM, "\\|");
        vehicleSkillCustomModifyParamList = StringUtils.stringToIntegerList(GameConfig.VEHICLE_SKILL_CUSTOM_MODIFY_PARAM, "\\|");

        configParam = GameConfig.VEHICLE_SKILL_MODIFY_SILVER_COST_PARAM.split(",");
        vehicleSkillModifySilverCostParam1 = Integer.parseInt(configParam[0]);
        vehicleSkillModifySilverCostParam2 = Integer.parseInt(configParam[1]);
        vehicleSkillModifySilverCostParam3 = Integer.parseInt(configParam[2]);
        vehicleSkillModifySilverCostParam4 = Integer.parseInt(configParam[3]);

        configParam = GameConfig.VEHICLE_SKILL_MODIFY_PARAM.split("\\|");
        vehicleSkillModifyParam1 = Integer.parseInt(configParam[0]);
        vehicleSkillModifyParam2 = Integer.parseInt(configParam[1]);

        //商战
        configParam = GameConfig.TRADE_WAR_BUY_BUFF_BASE_PARAM.split("\\|");
        tradeWarBuyBuffCostParam1 = Integer.parseInt(configParam[0]);
        tradeWarBuyBuffCostParam2 = Integer.parseInt(configParam[1]);

        configParam = GameConfig.CROSS_TRADE_WAR_BUY_BUFF_BASE_PARAM.split("\\|");
        crossTradeWarBuyBuffCostParam1 = Integer.parseInt(configParam[0]);
        crossTradeWarBuyBuffCostParam2 = Integer.parseInt(configParam[1]);

        configParam = GameConfig.TRADE_WAR_REWARD_PARAM.split("\\|");
        tradeWarRewardParam1 = Integer.parseInt(configParam[0]);
        tradeWarRewardParam2 = Integer.parseInt(configParam[1]);
        tradeWarRewardParam3 = Integer.parseInt(configParam[2]);

        configParam = GameConfig.CROSS_TRADE_WAR_REWARD_PARAM.split("\\|");
        crossTradeWarRewardParam1 = Integer.parseInt(configParam[0]);
        crossTradeWarRewardParam2 = Integer.parseInt(configParam[1]);
        crossTradeWarRewardParam3 = Integer.parseInt(configParam[2]);

        crossTradeWarNoticeNeedKillPatronsCountList = initCrossTradeWarNoticeNeedKillPatronsCountList();

        //美女
        configParam = GameConfig.BEAUTY_ADD_EXP_PARAM.split("\\|");
        beautyAddExpParam1 = Integer.parseInt(configParam[0]);
        beautyAddExpParam2 = Integer.parseInt(configParam[1]);
        beautyAddExpParam3 = Integer.parseInt(configParam[2]);

        configParam = GameConfig.BEAUTY_TRYST_MAKE_CHILD_WEIGHT.split("\\|");
        beautyTrystMakeChildParam1 = Integer.parseInt(configParam[0]);
        beautyTrystMakeChildParam2 = Integer.parseInt(configParam[1]);
        beautyTrystMakeChildParam3 = Integer.parseInt(configParam[2]);
        beautyTrystMakeChildParam4 = Integer.parseInt(configParam[3]);
        beautyTrystMakeChildParam5 = Integer.parseInt(configParam[4]);
        beautyTrystMakeChildParam6 = Integer.parseInt(configParam[5]);

        beautySkillNormalModifyParamList = StringUtils.stringToIntegerList(GameConfig.BEAUTY_SKILL_NORMAL_MODIFY_PARAM, "\\|");
        beautySkillCustomModifyParamList = StringUtils.stringToIntegerList(GameConfig.BEAUTY_SKILL_CUSTOM_MODIFY_PARAM, "\\|");

        configParam = GameConfig.BEAUTY_SKILL_MODIFY_SILVER_COST_PARAM.split(",");
        beautySkillModifySilverCostParam1 = Integer.parseInt(configParam[0]);
        beautySkillModifySilverCostParam2 = Integer.parseInt(configParam[1]);
        beautySkillModifySilverCostParam3 = Integer.parseInt(configParam[2]);
        beautySkillModifySilverCostParam4 = Integer.parseInt(configParam[3]);

        // 答题宠幸
        configParam = GameConfig.BEAUTY_FAVOR_TRAVEL_CHARM_ADD.split(";");
        beautyTravelGuessSuccessReward = Integer.parseInt(configParam[0]);
        beautyTravelGuessFailReward = Integer.parseInt(configParam[1]);

        configParam = GameConfig.BEAUTY_FAVOR_BATH_CHARM_ADD.split(";");
        beautyTravelPoetrySuccessReward = Integer.parseInt(configParam[0]);
        beautyTravelPoetryFailReward = Integer.parseInt(configParam[1]);

        //子嗣
        childSiteCountUnlockParamList = StringUtils.stringToIntegerList(GameConfig.CHILDREN_SITE_COUNT_UNLOCK_PARAM, "\\|");
        childAdultRewardItemIdList = StringUtils.stringToIntegerList(GameConfig.CHILDREN_ADULT_REWARD, "\\|");
        if(childAdultRewardItemIdList.size() != 5){
            return false;
        }
        childRandomOccupationList = StringUtils.stringToIntegerList(GameConfig.CHILD_RANDOM_OCCUPATION_PARAM, "\\|");
        configParam = GameConfig.CHILD_LONELY_EARN_SPEED_TITLE_EFFECT.split("\\|");
        childLonelyEarnSpeedTitleEffect1 = Integer.parseInt(configParam[0]);
        childLonelyEarnSpeedTitleEffect2 = Integer.parseInt(configParam[1]);
        childGrowStageAdditionList = initChildGrowStageAddition();

        //任务
        configParam = GameConfig.TASK_DAILY_ACTIVE_PARAM.split("\\|");
        List<Integer> activeList = new ArrayList<>();
        for(String activeStr : configParam){
            int active = Integer.parseInt(activeStr);
            activeList.add(active);
        }
        taskDailyActiveList = activeList;
        configParam = GameConfig.TASK_DAILY_ACTIVE_REWARD.split("\\|");
        List<Property> activeRewardList = new ArrayList<>();
        for(String rewardStr : configParam){
            Property reward = PropertyHelper.parseStringToProperty(rewardStr);
            activeRewardList.add(reward);
        }
        taskDailyActiveRewardList = activeRewardList;
        configParam = GameConfig.SEVEN_DAY_ACTIVE_PARAM.split("\\|");
        activeList = new ArrayList<>();
        for(String activeStr : configParam){
            int active = Integer.parseInt(activeStr);
            activeList.add(active);
        }
        sevenDayActiveList = activeList;
        configParam = GameConfig.SEVEN_DAY_LIMIT_BUY_GOODS_PARAM.split("\\|");
        List<Integer> mallIdList = new ArrayList<>();
        for(String mallIdStr : configParam){
            int mllId = Integer.parseInt(mallIdStr);
            mallIdList.add(mllId);
        }
        sevenDayLimitMallIdList = mallIdList;
        configParam = GameConfig.SEVEN_DAY_ACTIVE_REWARD.split("\\|");
        activeRewardList = new ArrayList<>();
        for(String rewardStr : configParam){
            Property reward = PropertyHelper.parseStringToProperty(rewardStr);
            activeRewardList.add(reward);
        }
        sevenDayActiveRewardList = activeRewardList;
        configParam = GameConfig.SIGN_REWARD_PARAM.split("\\|");
        Map<Integer, Property> rewardMap = new ConcurrentHashMap<>();
        for(int i = 0; i < configParam.length; i++){
            Property reward = PropertyHelper.parseStringToProperty(configParam[i]);
            rewardMap.put(i + 1, reward);
        }
        signRewardMap = rewardMap;

        //矿战
        configParam = GameConfig.MINE_WAR_OPEN_NEED_TITLE_PARAM.split("\\|");
        Map<Integer, Integer> titleMap = new ConcurrentHashMap<>();
        for(String titleParam : configParam){
            String[] titleArr = titleParam.split(";");
            int mineType = Integer.parseInt(titleArr[0]);
            int titleId = Integer.parseInt(titleArr[1]);
            if(mineType > 0 && titleId > 0){
                titleMap.put(mineType, titleId);
            }
        }
        mineOpenNeedTitleMap = titleMap;
        configParam = GameConfig.MINE_OUTPUT_ITEM_PARAM.split("\\|");
        Map<Integer, Integer> itemMap = new ConcurrentHashMap<>();
        for(String itemParam : configParam){
            String[] itemArr = itemParam.split(";");
            int mineType = Integer.parseInt(itemArr[0]);
            int itemId = Integer.parseInt(itemArr[1]);
            if(mineType > 0 && itemId > 0){
                itemMap.put(mineType, itemId);
            }
        }
        mineOutputItemMap = itemMap;
        mineRefugeOutputAdditionList = StringUtils.stringToIntegerList(GameConfig.MINE_WAR_SQUARE_PROFIT, "\\|");
        if(mineRefugeOutputAdditionList.size() != 3){
            return false;
        }

        //膜拜
        configParam = GameConfig.WORSHIP_REWARD_PARAM.split("\\|");
        worshipRewardParam1 = Integer.parseInt(configParam[0]);
        worshipRewardParam2 = Integer.parseInt(configParam[1]);

        //关卡
        passSilverBuyBuffCostList = StringUtils.stringToIntegerList(GameConfig.PASS_SILVER_BUY_BUFF_COST_PARAM, "\\|");

        //特权卡
        cardPrivilegeMap = initCardPrivilegeMap();

        //转盘
        turntableLotteryPossibleList = StringUtils.stringToIntegerList(GameConfig.TURNTABLE_LOTTERY_POSSIBLE_PARAM, "\\|");

        //乔迁风云
        configParam = GameConfig.ESTATE_WAR_WORSHIP_REWARD_PARAM.split("\\|");
        estateWarWorshipRewardParam1 = Integer.parseInt(configParam[0]);
        estateWarWorshipRewardParam2 = Integer.parseInt(configParam[1]);
        estateWarWorshipRewardParam3 = Integer.parseInt(configParam[2]);
        estateSkinList = StringUtils.stringToIntegerList(GameConfig.ESTATE_HOUSE_INIT_SKINS, "\\|");

        //联盟
        unionFlagList = StringUtils.stringToIntegerList(GameConfig.UNION_FLAG_PARAM, "\\|");
        configParam = GameConfig.UNION_CONSTRUCTION_PROGRESS.split("\\|");
        List<Integer> unionActiveList = new ArrayList<>();
        for(String activeStr : configParam){
            int active = Integer.parseInt(activeStr);
            unionActiveList.add(active);
        }
        unionConstructActiveList = unionActiveList;
        configParam = GameConfig.UNION_CONSTRUCTION_PROGRESS_REWARD.split("\\|");
        List<Property> unionActiveRewardList = new ArrayList<>();
        for(String rewardStr : configParam){
            Property reward = PropertyHelper.parseStringToProperty(rewardStr);
            unionActiveRewardList.add(reward);
        }
        unionConstructActiveRewardList = unionActiveRewardList;
        Map<Integer, Long> contributionMap = new ConcurrentHashMap<>();
        configParam = GameConfig.UNION_POSITION_NEED_CONTRIBUTION.split("\\|");
        contributionMap.put(eUnionPosition.Master.getValue(), Long.parseLong(configParam[0]));
        contributionMap.put(eUnionPosition.DeputyMaster.getValue(), Long.parseLong(configParam[1]));
        contributionMap.put(eUnionPosition.Elite.getValue(), Long.parseLong(configParam[2]));
        contributionMap.put(eUnionPosition.Member.getValue(), 0L);
        positionNeedContributionMap = contributionMap;

        //财神庙
        mammonSkillMap = initMammonSkillMap();

        //狩猎
        huntTimeData = initHuntTimeData();
        huntBoxRewardList = initHuntBoxRewardList();

        //祭祀
        sacrificeTimeData = initSacrificeTimeData();
        sacrificeAttackRewardParam = StringUtils.stringToIntegerList(GameConfig.SACRIFICE_ATTACK_REWARD_PARAM, "\\|");
        if(sacrificeAttackRewardParam.size() != 2){
            return false;
        }
        sacrificeBossLevelParam = StringUtils.stringToIntegerList(GameConfig.SACRIFICE_BOSS_LEVEL_PARAM, "\\|");
        if(sacrificeBossLevelParam.size() != 5){
            return false;
        }
        sacrificeDamageRankRewardList = initSacrificeDamageRankRewardList();
        if(null == sacrificeDamageRankRewardList || sacrificeDamageRankRewardList.size() < 1){
            return false;
        }

        //定位映射
        needTranslateLocationCity = StringUtils.stringToStringList(GameConfig.NEED_TRANSLATE_LOCATION_CITY, ";");
        randomLocationCity = StringUtils.stringToStringList(GameConfig.RANDOM_LOCATION_CITY, ";");
        noTranslateCity = StringUtils.stringToStringList(GameConfig.NO_TRANSLATE_CITY, ";");

        //游历
        configParam = GameConfig.TRAVEL_MANY_GO_PARAM.split(",");
        travelMultiTimes = Integer.parseInt(configParam[0]);
        travelMultiNeedTitle = Integer.parseInt(configParam[1]);
        travelDefaultEventList = initTravelDefaultEventList();
        brothelBeautyList = StringUtils.stringToIntegerList(GameConfig.BROTHEL_BEAUTY_LIST, "\\|");
        brothelInteractiveTypeMap = initBrothelInteractiveTypeMap();
        casinoInteractiveTypeMap = initCasinoInteractiveTypeMap();
        drinkInteractiveTypeList = initDrinkInteractiveTypeList();

        //皮肤商店
        configParam = GameConfig.SKIN_MALL_RANDOM_SHOW_NUM.split("\\|");
        skinMallPatronsNum = Integer.parseInt(configParam[0]);
        skinMallBeautyNum = Integer.parseInt(configParam[1]);

        configParam = GameConfig.ASSISTANT_SKIN_MALL_RANDOM_SHOW_NUM.split("\\|");
        skinMallAssistantNum = Integer.parseInt(configParam[0]);
        skinMallAssistantUpdateDays= Integer.parseInt(configParam[1]);

        hootDishesTypeMap = initHotDishesMap();
        dishesOccupationMap = initDishesOccupationMap();

        //菜品品质基础分数
        dishesQualityScoreList = StringUtils.stringToIntegerList(GameConfig.INN_DISHES_QUALITY_SCORE,"\\|") ;

        //菜品等级影响分数参数

        configParam = GameConfig.INN_DISHES_LEVEL_SCORE.split("\\|");

        dishesLevelScoreParam1 = Integer.parseInt(configParam[0]);

        dishesLevelScoreParam2 = Integer.parseInt(configParam[1]);

        dishesLevelScoreParam3 = Integer.parseInt(configParam[2]);

        //菜品评分加成map
        dishesScoreList = initDishesScoreAdditionList();

        //菜品分数随机区间
        configParam = GameConfig.INN_DISHES_RANDOM_PARAM.split("\\|");

        dishesScoreRandomParam1 = Integer.parseInt(configParam[0]);

        dishesScoreRandomParam2 = Integer.parseInt(configParam[1]);

        zsSkillList = StringUtils.stringToIntegerList(GameConfig.ZHAOSHANG_SKILL_ID_PARAM,"\\|");

        zsProjectOpenTime = StringUtils.stringToIntegerList(GameConfig.ZHAOSHANG_OPEN_ROB_TIME, "\\|");

        zsProjectOpenMultiple = StringUtils.stringToIntegerList(GameConfig.ZS_PROJECT_MAX_OPEN_MULTIPLE, "\\|");

        if(zsProjectOpenTime.size() != 4){
            return false;
        }
        //联姻消耗
        marriageConsumeList = initMarriageConsume();


        passRoadEventNum = initPassRoadEventNum();

        // 榷场
        initMonopolyMarketGameConfig();

        // 新榷场
        initNewMonopolyMarketGameConfig();

        //厢房
        initWingRoomConfig();
        // 药铺
        initDrugStore();

        //系统预告
        systemPreviewRewardMap = initSystemPreviewRewardMap();

        ConfigMgr.wineryFriendlyRewardMap = initWineryFriendlyRewardMap();
        ConfigMgr.wineryDispatchCoolDownTimeHour = initWineryDispatchCoolDownTimeHour();
        ConfigMgr.wineryDrunkFriendlyConfigs = initWineryDrunkFriendlyAddConfig();
        ConfigMgr.wineryDispatchStaffSkillListMap = initWineryDispatchSKillList();
        ConfigMgr.wineryProcessProbabilityFormula = initWineryProcessProbabilityFormulaList();
        ConfigMgr.wineryProcessWeightsFormula2 = initWineryProcessWeightsFormula2();
        ConfigMgr.wineryProcessWeightFormula1List = initWineryProcessWeightsFormula1List();
        ConfigMgr.wineryInitItemReward = initWineryInitItemRewardMap();
        ConfigMgr.wineryAbilityFormulaList = initWineryAbilityFormulaList();
        ConfigMgr.wineryDispatchSkillUpgrade = GameConfig.WINERY_DISPATCH_SKILL_UPGRADE;

        localChatLimitList = initChatLimitList(GameConfig.CHAT_NEED_TITLE_DAY);
        crossChatLimitList = initChatLimitList(GameConfig.CROSS_CHAT_NEED_TITLE_DAY);

        tradeWarTrackTimesByVipList = StringUtils.stringToIntegerList(GameConfig.TRADE_WAR_WANTED_VIP_LIMIT_NUM, "\\|");

        //押镖
        //解析镖车机器人
        Map<Integer, EscortBeautyCartNPCInfo> tempCartNPCInfoMap = BeautyEscortConfig.parseCartNPCInfo();
        if(tempCartNPCInfoMap.size() == 0){
            return false;
        }
        //走镖每日开放时间
        List<Integer> timeList = StringUtils.stringToIntegerList(GameConfig.ESCORT_FIGHT_TIME_RANGE, ";");
        if(timeList.size() != 2){
            return false;
        }
        //劫镖损失
        List<Integer> tempRobberLoss = StringUtils.stringToIntegerList(GameConfig.ESCORT_ROBBER_LOSS, ";");
        if(tempRobberLoss.size() != 2){
            return false;
        }
        //走镖事件概率
        List<Integer> tempProbability = StringUtils.stringToIntegerList(GameConfig.ESCORT_EVENT_PROBABILITY, "\\|");
        if(tempProbability.size() != 3){
            return false;
        }
        //NPC机器人镖车类型
        Map<Integer, EscortDartTypeInfo> tempDartTypeInfoMap = BeautyEscortConfig.parseDartTypeInfo(GameConfig.ESCORT_ROBOTS_DARK_CAR_CONFIG);
        if(!tempDartTypeInfoMap.containsKey(0)){
            return false;
        }
        //劫镖次数恢复消耗
        List<Integer> tempFightBuyConsume = StringUtils.stringToIntegerList(GameConfig.ESCORT_FIGHT_TIMES_RECOVER_CONSUME_CONFIG, ";");
        if(tempFightBuyConsume.size() != 3){
            return false;
        }
        //押镖次数恢复消耗
        List<Integer> tempEscortBuyConsume = StringUtils.stringToIntegerList(GameConfig.ESCORT_CONSUME_ITEM_NUM, ";");
        if(tempEscortBuyConsume.size() != 3){
            return false;
        }
        List<EscortWeekRewardInfo> tempList  = BeautyEscortConfig.initRankRewardInfo(GameConfig.ESCORT_WEEK_RANK_REWARD);
        if(tempList == null){
            return false;
        }
        List<EscortWeekRewardInfo> tempChairManList  = BeautyEscortConfig.initRankRewardInfo(GameConfig.ESCORT_CHAIRMAN_WEEK_RANK_REWARD);
        if(tempChairManList == null){
            return false;
        }
        List<EscortWeekRewardInfo> crossTempList  = BeautyEscortConfig.initRankRewardInfo(GameConfig.ESCORT_CROSS_SERVER_WEEK_RANK_REWARD);
        if(crossTempList == null){
            return false;
        }
        List<EscortWeekRewardInfo> crossTempChairManList  = BeautyEscortConfig.initRankRewardInfo(GameConfig.ESCORT_CROSS_SERVER_CHAIRMAN_WEEK_RANK_REWARD);
        if(crossTempChairManList == null){
            return false;
        }
        rankRewardList = tempList;
        rankChairRewardList = tempChairManList;
        rankCrossRewardList = crossTempList;
        rankCrossChairRewardList = crossTempChairManList;
        escortBuyConsume = tempEscortBuyConsume;
        fightBuyConsume = tempFightBuyConsume;
        robotDartCartType = tempDartTypeInfoMap.get(0);
        //走镖每日开放时间
        ESCORTING_START_MINUTE = timeList.get(0);
        ESCORTING_END_MINUTE = timeList.get(1);
        //劫镖损失
        robberLoss = tempRobberLoss;
        MAX_ROB_TIMES_IN_LOSS = robberLoss.get(1);
        //走镖事件概率
        ESCORT_EVENT_PROBABILITY = tempProbability;
        //NPC镖车
        cartNPCInfoMap = tempCartNPCInfoMap;
        //解析镖车类型
        dartTypeInfoMap = BeautyEscortConfig.parseDartTypeInfo(GameConfig.ESCORT_DARK_CAR_CONFIG);

        monthAbilityRankGradeConfigs = parseMonthAbilityRankConfig();
        crossUnionJoinExConfig = parseCrossUnionJoinExConfig();
        //周卡
        //任务
        configParam = GameConfig.SUBSCRIBE_WEEK_CARD_TRY_OUT_PARAM.split("\\|");
        weekCardExperimentTimes = Integer.parseInt(configParam[0]);
        weekCardExperimentDay = Integer.parseInt(configParam[1]);

        //linlee茶联动
        configParam = GameConfig.LINLEE_SKIN_REPLACE.split(";");
        linLeeSkinReplaceType = Integer.parseInt(configParam[0]);
        linLeeSkinReplaceId = Integer.parseInt(configParam[1]);

        handle20ConfigReplace();
        if (parsePatronsSakeConfig()) return false;

        return true;
    }

    public static List<RankGradeInfo> parseMonthAbilityRankConfig() {
        List<RankGradeInfo> configInfos = new ArrayList<>();
        //跨服商会-财力排行榜玩家评定配置 皇商结束名次占比；巨贾结束名次占比；豪商结束名次占比 ；富商结束名次占比 (左闭又开
        List<Integer> rankPercents = StringUtils.stringToIntegerList(GameConfig.UNION_PLAYER_POWER_RANK, ";");
        for (int i = 0; i < rankPercents.size(); i++) {
            int gradeId = i + 1;
            int rankPercent = rankPercents.get(i);
            RankGradeInfo rankGradeInfo = new RankGradeInfo(rankPercent, gradeId);
            configInfos.add(rankGradeInfo);
        }

        return configInfos;
    }

    public static CrossUnionJoinExInfo parseCrossUnionJoinExConfig() {
        CrossUnionJoinExInfo info = new CrossUnionJoinExInfo();
        //跨服商会-可容纳评定人数配置 皇商人数；巨贾人数；豪商人数；富商人数
        List<Integer> limitList = StringUtils.stringToIntegerList(GameConfig.UNION_PLAYER_POWER_NUM, ";");
        for (int i = 0; i < limitList.size(); i++) {
            int gradeId = i + 1;
            info.getGradeNumLimitMap().put(gradeId, limitList.get(i));
        }
        return info;
    }

    public static void parseUnionCampWarConfig(){
        UnionCampWarConfig config = new UnionCampWarConfig();
        config.setSHANGBANG_APPLY_TIME(GameConfig.SHANGBANG_APPLY_TIME);
        config.setSHANGBANG_ATTACK_TIME(GameConfig.SHANGBANG_ATTACK_TIME);
        config.setSHANGBANG_REWARD_TIME(GameConfig.SHANGBANG_REWARD_TIME);
        config.setSHANGBANG_TITLE_SET(GameConfig.SHANGBANG_TITLE_SET);
        config.setSHANGBANG_BUFF(GameConfig.SHANGBANG_BUFF);

        config.setAttackTimesMax(GameConfig.SHANGBANG_ATTACK_NUM_MAX);
        config.setNoticeNeedDefeatNum(GameConfig.SHANGBANG_HOLD_REPORT_NUM_LIMIT);
        config.setTopUnionCount(GameConfig.SHANGBANG_DEFENSE_NUM);
        config.setPatronsAttackLimit(GameConfig.SHANGBANG_ATTACK_PARTON_NUM_MAX);
        config.setAttackPatronsNum(GameConfig.SHANGBANG_ATTACK_SEND_NUM);
//        config.setBoxNum(GameConfig.SHANGBANG_LOTTERY_BOX_NUM);
        config.setChatNumMax(GameConfig.SHANGBANG_NOTICE_CHAT_NUM_MAX);

//        config.setAttackTimesInit(GameConfig.SHANGBANG_ATTACK_NUM_BEGIN);
//        String[] split = GameConfig.SHANGBANG_ATTACK_NUM_RESTORE.split("\\|");
//        config.setAttackTimesRecoverCD(Integer.parseInt(split[0]));
//        config.setAttackTimesRecoverValue(Integer.parseInt(split[1]));

//        config.setFirstNeedCampHpPercent(GameConfig.SHANGBANG_ATTACK_MASTER_LIMIT);

        List<Long> longs = StringUtils.stringToLongList(GameConfig.SHANGBANG_ATTACK_NUM_RESTORE, "\\|");
        List<Long> recoverTimeList = new ArrayList<>();
        for (Long minute : longs) {
            recoverTimeList.add(minute * DateHelper.MINUTE_SECONDS);
        }
        config.setAttackTimesRecoverTimeList(recoverTimeList);

        List<Integer> hpParams1 = StringUtils.stringToIntegerList(GameConfig.SHANGBANG_HP_PARAM_1, "\\|");
        List<Integer> hpParams2 = StringUtils.stringToIntegerList(GameConfig.SHANGBANG_HP_PARAM_2, "\\|");
        List<List<Integer>> hpParams3 = new ArrayList<>();
        for (String s : GameConfig.SHANGBANG_HP_PARAM_3.split("\\|")) {
            List<Integer> list = StringUtils.stringToIntegerList(s, ";");
            hpParams3.add(list);
        }
        List<Integer> hpParams4 = StringUtils.stringToIntegerList(GameConfig.SHANGBANG_HP_PARAM_4, "\\|");
        List<List<Integer>> combAttList = new ArrayList<>();
        for (String s : GameConfig.SHANGBANG_COMBO_ATT.split("\\|")) {
            List<Integer> list = StringUtils.stringToIntegerList(s, ";");
            combAttList.add(list);
        }
        config.setHpParams1(hpParams1);
        config.setHpParams2(hpParams2);
        config.setHpParams3(hpParams3);
        config.setHpParams4(hpParams4);
        config.setCombAttList(combAttList);

        List<Integer> list = StringUtils.stringToIntegerList(GameConfig.SHANGBANG_WORSHIP_NUM, "\\|");
        config.setWorshipRandomList(list);

        config.initConfig();

        unionCampWarConfig = config;
    }


    public static Map<Integer, Map<Integer, Integer>> getHootDishesTypeMap() {
        return hootDishesTypeMap;
    }

    public static Map<Integer, List<Integer>> getDishesOccupationMap() {
        return dishesOccupationMap;
    }

    private List<InnScore> initDishesScoreAdditionList() {
        List<InnScore> list = new ArrayList<>();
        String  str = GameConfig.INN_DISHES_SCORE_ADDTION;
        if (null != str && str.trim().length() > 0){
            String[] split = str.trim().split("\\|");
            for(int i = 0;i<split.length;i++){
                String[] params = split[i].trim().split(";");
                if(params.length!=2){
                    continue;
                }
                InnScore innScore = new InnScore();
                innScore.setScore(Integer.parseInt(params[0]));
                innScore.setValue(Integer.parseInt(params[1]));
                list.add(innScore);
            }
        }
        return list;
    }

    private Map<Integer,List<Integer>> initDishesOccupationMap(){
        Map<Integer, List<Integer>> map = new ConcurrentHashMap<>();
        String  str = GameConfig.INN_DISHES_OCCUPATION;
        if (null != str && str.trim().length() > 0){
            String[] split = str.trim().split("\\|");
            for(int i = 0;i<split.length;i++){
                if(!map.containsKey(i+1)){
                    map.put(i+1,new ArrayList<>());
                }
                String[] occupations = split[i].trim().split(",");
                for(String oid:occupations){
                      map.get(i+1).add(Integer.parseInt(oid));
                }
            }
        }
        return map;

    }
    private Map<Integer, Map<Integer, Integer>> initHotDishesMap() {

        Map<Integer, Map<Integer, Integer>> map = new ConcurrentHashMap<>();
        String hotDishesStr = GameConfig.INN_HOT_DISHES;
        if (null != hotDishesStr && hotDishesStr.trim().length() > 0) {
            String[] split = hotDishesStr.trim().split("\\|");
            for(int i = 0;i<split.length;i++){
                if(!map.containsKey(i+1)){
                    map.put(i+1,new ConcurrentHashMap<>());
                }
                String[] dayInfo = split[i].trim().split(",");
                for(String dishesInfo:dayInfo){
                    String[] detailInfo = dishesInfo.trim().split(";");
                    if(detailInfo.length!=2){
                        continue;
                    }
                    map.get(i+1).put(Integer.parseInt(detailInfo[0]),Integer.parseInt(detailInfo[1]));
                }
            }
        }
        return map;
    }

    private static List<CrossTradeWarNoticeKillPatronsConfig> initCrossTradeWarNoticeNeedKillPatronsCountList(){
        List<CrossTradeWarNoticeKillPatronsConfig> dataList = new ArrayList<>();
        String[] configParam = GameConfig.CROSS_TRADE_WAR_NOTICE_NEED_KILL_PATRONS_COUNT.split("\\|");
        for(String configStr : configParam){
            String[] paramArr = configStr.split(";");
            CrossTradeWarNoticeKillPatronsConfig tempConfig = new CrossTradeWarNoticeKillPatronsConfig();
            tempConfig.setServerCount(Integer.parseInt(paramArr[0]));
            tempConfig.setNeedKillPatronsCount(Integer.parseInt(paramArr[1]));
            dataList.add(tempConfig);
        }
        return dataList;
    }

    private static List<ChildGrowStageAddition> initChildGrowStageAddition(){
        List<ChildGrowStageAddition> dataList = new ArrayList<>();
        String[] configParam = GameConfig.CHILD_GROW_ADD_EARNSPEED_PARAM.split("\\|");
        for(String configStr : configParam){
            String[] paramArr = configStr.split(";");
            ChildGrowStageAddition stageAddition = new ChildGrowStageAddition();
            stageAddition.setGrowStage(Integer.parseInt(paramArr[0]));
            stageAddition.setAddition(Integer.parseInt(paramArr[1]));
            dataList.add(stageAddition);
        }
        return dataList;
    }

    private static List<DrinkInteractiveType> initDrinkInteractiveTypeList(){
        List<DrinkInteractiveType> dataList = new ArrayList<>();
        int totalWeight = 0;
        String[] configParam = GameConfig.DRINK_INTERACTIVE_PARAM.split("\\|");
        int type = 1;
        for(String configStr : configParam){
            String[] paramArr = configStr.split(";");
            DrinkInteractiveType interactiveType = new DrinkInteractiveType();
            interactiveType.setType(type);
            interactiveType.setAddTravelPowerCount(Integer.parseInt(paramArr[0]));
            interactiveType.setWeight(Integer.parseInt(paramArr[1]));
            totalWeight += interactiveType.getWeight();
            dataList.add(interactiveType);
            type++;
        }
        drinkInteractiveTotalWeight = totalWeight;
        return dataList;
    }

    private static List<TravelDefaultEvent> initTravelDefaultEventList(){
        List<TravelDefaultEvent> dataList = new ArrayList<>();
        String[] configParam = GameConfig.TRAVEL_DEFAULT_EVENT_LIST.split("\\|");
        for(String configStr : configParam){
            String[] paramArr = configStr.split(";");
            TravelDefaultEvent defaultEvent = new TravelDefaultEvent();
            defaultEvent.setCityId(Integer.parseInt(paramArr[0]));
            defaultEvent.setEventId(Integer.parseInt(paramArr[1]));
            dataList.add(defaultEvent);
        }
        return dataList;
    }

    private static Map<Integer, BrothelInteractiveType> initBrothelInteractiveTypeMap(){
        Map<Integer, BrothelInteractiveType> dataMap = new ConcurrentHashMap<>();
        String[] configParam = GameConfig.BROTHEL_INTERACTIVE_PARAM.split("\\|");
        int type = 1;
        for(String typeStr : configParam){
            String[] typeArr = typeStr.split(",");
            Property consume = PropertyHelper.parseStringToProperty(typeArr[0]);
            int unlockValue = Integer.parseInt(typeArr[1]);
            BrothelInteractiveType interactiveType = new BrothelInteractiveType();
            interactiveType.setType(type);
            interactiveType.setConsume(consume);
            interactiveType.setUnlockValue(unlockValue);
            dataMap.put(interactiveType.getType(), interactiveType);
            if(consume.getGoods().containsKey(GameConfig.GAME_MONEY_INGOTS) && consume.getCountByGoodsId(GameConfig.GAME_MONEY_INGOTS).intValue() == 0){
                brothelFreeType = type;
            }
            type++;
        }
        return dataMap;
    }
    private static Map<Integer, CasinoInteractiveType> initCasinoInteractiveTypeMap(){
        Map<Integer, CasinoInteractiveType> dataMap = new ConcurrentHashMap<>();
        String[] configParam = GameConfig.CASINO_INTERACTIVE_PARAM.split("\\|");
        int type = 1;
        int maxValue = 0;
        for(String typeStr : configParam){
            String[] typeArr = typeStr.split(";");
            CasinoInteractiveType interactiveType = new CasinoInteractiveType();
            interactiveType.setType(type);
            interactiveType.setDiceCount(Integer.parseInt(typeArr[0]));
            interactiveType.setRewardIngotsCount(Integer.parseInt(typeArr[1]));
            int value = interactiveType.getRewardIngotsCount();
            interactiveType.setReward(new Property(GameConfig.GAME_MONEY_INGOTS, BigInteger.valueOf(value)));
            dataMap.put(interactiveType.getType(), interactiveType);
            if(maxValue < value){
                bestRewardCasinoInteractiveType = type;
            }
            type++;
        }
        return dataMap;
    }

    private static List<SacrificeDamageRankReward> initSacrificeDamageRankRewardList(){
        int maxRank = 0;
        List<SacrificeDamageRankReward> dataList = new ArrayList<>();
        String[] configParam = GameConfig.SACRIFICE_DAMAGE_RANK_REWARD_PARAM.split("\\|");
        for(String rewardStr : configParam){
            String[] rewardParam = rewardStr.split(",");
            SacrificeDamageRankReward rankReward = new SacrificeDamageRankReward();
            rankReward.setMinRank(Integer.parseInt(rewardParam[0]));
            rankReward.setMaxRank(Integer.parseInt(rewardParam[1]));
            rankReward.setReward(PropertyHelper.parseStringToProperty(rewardParam[2]));
            if(rankReward.getMinRank() < 0 || rankReward.getMaxRank() < 0 || rankReward.getMaxRank() < rankReward.getMinRank()){
                return null;
            }
            if(rankReward.getMaxRank() > maxRank){
                maxRank = rankReward.getMaxRank();
            }
            dataList.add(rankReward);
        }
        sacrificeDamageMaxRank = maxRank;
        return dataList;
    }

    private static List<HuntBoxReward> initHuntBoxRewardList(){
        List<HuntBoxReward> dataList = new ArrayList<>();
        String[] configParam = GameConfig.HUNT_BOX_REWARD_PARAM.split("\\|");
        for(String rewardStr : configParam){
            String[] rewardParam = rewardStr.split(",");
            int count = Integer.parseInt(rewardParam[1]);
            HuntBoxReward huntBoxReward = new HuntBoxReward();
            huntBoxReward.setNoticeType(Integer.parseInt(rewardParam[2]));
            huntBoxReward.setReward(PropertyHelper.parseStringToProperty(rewardParam[0]));
            for(int i = 0; i < count; i++){
                dataList.add(huntBoxReward);
            }
        }
        return dataList;
    }

    private static SacrificeTimeData initSacrificeTimeData(){
        SacrificeTimeData timeData = new SacrificeTimeData();
        String[] configParam = GameConfig.SACRIFICE_TIME_PARAM.split("\\|");
        String[] timeParam = configParam[0].split(":");
        timeData.setStartHour(Integer.parseInt(timeParam[0]));
        timeData.setStarMinute(Integer.parseInt(timeParam[1]));
        timeParam = configParam[1].split(":");
        timeData.setEndHour(Integer.parseInt(timeParam[0]));
        timeData.setEndMinute(Integer.parseInt(timeParam[1]));
        return timeData;
    }

    private static HuntTimeData initHuntTimeData(){
        HuntTimeData timeData = new HuntTimeData();
        String[] configParam = GameConfig.HUNT_TIME_PARAM.split("\\|");
        String[] timeParam = configParam[0].split(":");
        timeData.setStartHour(Integer.parseInt(timeParam[0]));
        timeData.setStarMinute(Integer.parseInt(timeParam[1]));
        timeParam = configParam[1].split(":");
        timeData.setEndHour(Integer.parseInt(timeParam[0]));
        timeData.setEndMinute(Integer.parseInt(timeParam[1]));
        return timeData;
    }

    private static Map<Integer, MammonSkill> initMammonSkillMap(){
        Map<Integer, MammonSkill> dataMap = new ConcurrentHashMap<>();
        String[] configParam = GameConfig.MAMMON_TYPE_PARAM.split("\\|");
        for(String mammonParam : configParam){
            String[] mammonArr = mammonParam.split(";");
            MammonSkill mammonSkill = new MammonSkill();
            mammonSkill.setMammonSkillId(Integer.parseInt(mammonArr[0]));
            mammonSkill.setAddIngots(Integer.parseInt(mammonArr[1]));
            dataMap.put(mammonSkill.getMammonSkillId(), mammonSkill);
        }
        return dataMap;
    }

    public static MammonSkill getRandomMammonSkill(){
        List<MammonSkill> dataList = new ArrayList<>(mammonSkillMap.values());
        if(dataList.size() > 0) {
            int index = threadRandom.next(0, dataList.size());
            return dataList.get(index);
        }
        return null;
    }

    /**
     * 获取参拜财神殿最垃圾奖励的技能 找回奖励要用
     *
     * @return
     */

    public static MammonSkill getLeastRewardMammonSkill() {
        List<MammonSkill> dataList = new ArrayList<>(mammonSkillMap.values());
        MammonSkill leastRewardSkill = dataList.get(0);
        for (MammonSkill mammonSkill : dataList) {
            if (mammonSkill.getAddIngots() < leastRewardSkill.getAddIngots()) {
                leastRewardSkill = mammonSkill;
            }
        }
        return leastRewardSkill;
    }

    /**
     * 获取膜拜排行榜最垃圾的奖励 找回奖励要用
     *
     * @return
     */
    public static int getLeastWorshipRankReward() {
        return worshipRewardParam1;
    }


    private static Map<Integer, CardPrivilege> initCardPrivilegeMap(){
        Map<Integer, CardPrivilege> cardMap = new ConcurrentHashMap<>();
        String[] configParam = GameConfig.WEEK_CARD_PRIVILEGE_PARAM.split("\\|");
        boolean isOneKeyDealPassRoadEvent = false;
        if(configParam.length >= 8){
            isOneKeyDealPassRoadEvent = ("1".equals(configParam[7]));
        }
        CardPrivilege monthCard = new CardPrivilege(Integer.parseInt(configParam[0]), Integer.parseInt(configParam[1]), Integer.parseInt(configParam[2]),
                Integer.parseInt(configParam[3]), Integer.parseInt(configParam[4]), Integer.parseInt(configParam[5]), 0, false,
                Integer.parseInt(configParam[6]), false, isOneKeyDealPassRoadEvent, false, false,
                0, 0, 0);
        cardMap.put(eCardType.MonthCard.getValue(), monthCard);
        configParam = GameConfig.LIFE_CARD_PRIVILEGE_PARAM.split("\\|");
        CardPrivilege yearCard = new CardPrivilege(Integer.parseInt(configParam[0]), Integer.parseInt(configParam[1]), Integer.parseInt(configParam[2]),
                Integer.parseInt(configParam[3]), 0, 0, Integer.parseInt(configParam[4]), "1".equals(configParam[5]),
                Integer.parseInt(configParam[6]), "1".equals(configParam[7]), false, false, false,
                0, 0, 0);
        cardMap.put(eCardType.YearCard.getValue(), yearCard);
        configParam = GameConfig.SUBSCRIBE_WEEK_CARD_PRIVILEGE_PARAM.split("\\|");
        CardPrivilege weekCard = new CardPrivilege(0, 0, 0,
                Integer.parseInt(configParam[2]), 0, 0, 0, false,
                0, false, false, "1".equals(configParam[0]), "1".equals(configParam[1]),
                Integer.parseInt(configParam[3]), Integer.parseInt(configParam[4]), Integer.parseInt(configParam[5]));
        cardMap.put(eCardType.WeekCard.getValue(), weekCard);
        return cardMap;
    }

    /**
     * 初始化榷场 gameConfig配置
     */
    private static void initMonopolyMarketGameConfig(){
        resGrabConsumeMap.clear();
        fortressRankRewardMap.clear();
        // 榷署
        String[] officeOpenSecondOpenTime = GameConfig.MONOPOLYMARKET_OPENTIME_1.split("\\|");
        officeOpenSecond = Integer.parseInt(officeOpenSecondOpenTime[0]);
        officeEndSecond = Integer.parseInt(officeOpenSecondOpenTime[1]);

        String[] resGrabKingOpenTime = GameConfig.MONOPOLYMARKET_OPENTIME_2.split("\\|");
        resGrabKingOpenSecond = Integer.parseInt(resGrabKingOpenTime[0]);
        resGrabKingEndSecond = Integer.parseInt(resGrabKingOpenTime[1]);

        String[] resGrabQueenOpenTime = GameConfig.MONOPOLYMARKET_OPENTIME_3.split("\\|");
        resGrabQueenOpenSecond = Integer.parseInt(resGrabQueenOpenTime[0]);
        resGrabQueenEndSecond = Integer.parseInt(resGrabQueenOpenTime[1]);
        // 要塞 派遣期
        String[] fortressDispatchOpenTime = GameConfig.MONOPOLYMARKET_BIANGUAN_PAIQIAN_TIME.split("\\|");
        fortressDispatchPeriodOpenSecond = Integer.parseInt(fortressDispatchOpenTime[0]);
        fortressDispatchPeriodEndSecond = Integer.parseInt(fortressDispatchOpenTime[1]);
        // 要塞 结算期
        String[] fortressSettlementOpenTime = GameConfig.MONOPOLYMARKET_BIANGUAN_JIESUAN_TIME.split("\\|");
        fortressSettlementPeriodOpenSecond = Integer.parseInt(fortressSettlementOpenTime[0]);
        fortressSettlementPeriodEndSecond = Integer.parseInt(fortressSettlementOpenTime[1]);
        // 要塞 采集期
        String[] fortressCollectingOpenTime = GameConfig.MONOPOLYMARKET_BIANGUAN_CAIJI_TIME.split("\\|");
        fortressCollectingPeriodOpenSecond = Integer.parseInt(fortressCollectingOpenTime[0]);
        fortressCollectingPeriodEndSecond = Integer.parseInt(fortressCollectingOpenTime[1]);
        // 要塞 采集期
        String[] fortressRestOpenTime = GameConfig.MONOPOLYMARKET_BIANGUAN_XUIXI_TIME.split("\\|");
        fortressRestPeriodOpenSecond = Integer.parseInt(fortressRestOpenTime[0]);
        fortressRestPeriodEndSecond = Integer.parseInt(fortressRestOpenTime[1]);
        // 抢占榷署元宝消耗（初始值|递增值|最大值）
        officeConsume = new MonopolyMarketConsume(GameConfig.MONOPOLYMARKET_SEIZECOST_1);
        // 资源争夺战 鼓舞消耗  k:type
        MonopolyMarketConsume consume2 = new MonopolyMarketConsume(GameConfig.MONOPOLYMARKET_BUFF_COST_2);
        resGrabConsumeMap.put(eMonopolyMarketResType.RES_KING.getValue(),consume2);
        MonopolyMarketConsume consume3 = new MonopolyMarketConsume(GameConfig.MONOPOLYMARKET_BUFF_COST_3);
        resGrabConsumeMap.put(eMonopolyMarketResType.RES_QUEEN.getValue(),consume3);
        // 要塞奖励
        String[] rankArray = GameConfig.MONOPOLYMARKET_BIANGUAN_RANK.split("#");
        int id = 1;
        for (String rank : rankArray){
            String[] rankInfo = rank.split("\\|");
            List list = new ArrayList();
            for (String rankInfoStr : rankInfo){
                String[] item = rankInfoStr.split(",");
                MonopolyMarketFortressRankReward rankReward = new MonopolyMarketFortressRankReward();
                rankReward.startRank = Integer.valueOf(item[0]);
                rankReward.endRank = Integer.valueOf(item[1]);
                rankReward.leaderReward = item[2];
                rankReward.reward = item[3];
                list.add(rankReward);
            }
            fortressRankRewardMap.put(id++,list);
        }
        // 解析 资源战每天开始和结束时间
        kingDailyOpenTime = (int)(resGrabKingOpenSecond % DateHelper.DAY_SECONDS) ;
        kingDailyEndTime = (int)(resGrabKingEndSecond % DateHelper.DAY_SECONDS == 0 ? DateHelper.DAY_SECONDS : resGrabKingEndSecond % DateHelper.DAY_SECONDS);

        queenDailyOpenTime = (int)(resGrabQueenOpenSecond % DateHelper.DAY_SECONDS) ;
        queenDailyEndTime = (int)(resGrabQueenEndSecond % DateHelper.DAY_SECONDS == 0 ? DateHelper.DAY_SECONDS : resGrabQueenEndSecond % DateHelper.DAY_SECONDS) ;

        //孙子
        grandChildProfessionSkillList = StringUtils.stringToIntegerList(GameConfig.GRAND_CHILD_PROFESSION_SKILL_ID, ";");
        grandChildOccupationList = StringUtils.stringToIntegerList(GameConfig.GRAND_CHILD_OCCUPATION_NUM, "\\|");
    }


    /**
     * 初始化新榷场 gameConfig配置
     */
    private static void initNewMonopolyMarketGameConfig(){

        // 榷署
        String[] officeOpenSecondOpenTime = GameConfig.NEWMONOPOLYMARKET_OPENTIME_1.split("\\|");
        officeOpenSecondNew = Integer.parseInt(officeOpenSecondOpenTime[0]);
        officeEndSecondNew = Integer.parseInt(officeOpenSecondOpenTime[1]);

        String[] resGrabKingOpenTime = GameConfig.NEWMONOPOLYMARKET_OPENTIME_2.split("\\|");
        resGrabKingOpenSecondNew = Integer.parseInt(resGrabKingOpenTime[0]);
        resGrabKingEndSecondNew = Integer.parseInt(resGrabKingOpenTime[1]);

        String[] resGrabQueenOpenTime = GameConfig.NEWMONOPOLYMARKET_OPENTIME_3.split("\\|");
        resGrabQueenOpenSecondNew = Integer.parseInt(resGrabQueenOpenTime[0]);
        resGrabQueenEndSecondNew = Integer.parseInt(resGrabQueenOpenTime[1]);

        List<Integer> tempList = StringUtils.stringToIntegerList(GameConfig.NEWMONOPOLYMARKET_RANK_TIME, "\\|");
        newMonopolyOpenRankTime = tempList.get(0);
        newMonopolyEndRankTime = tempList.get(1);

        // 抢占榷署元宝消耗（初始值|递增值|最大值）
        officeConsumeNew = new MonopolyMarketConsume(GameConfig.NEWMONOPOLYMARKET_SEIZECOST_1);

        // 解析 资源战每天开始和结束时间
        kingDailyOpenTimeNew = (int)(resGrabKingOpenSecondNew % DateHelper.DAY_SECONDS) ;
        kingDailyEndTimeNew = (int)(resGrabKingEndSecondNew % DateHelper.DAY_SECONDS == 0 ? DateHelper.DAY_SECONDS : resGrabKingEndSecondNew % DateHelper.DAY_SECONDS);

        queenDailyOpenTimeNew = (int)(resGrabQueenOpenSecondNew % DateHelper.DAY_SECONDS) ;
        queenDailyEndTimeNew = (int)(resGrabQueenEndSecondNew % DateHelper.DAY_SECONDS == 0 ? DateHelper.DAY_SECONDS : resGrabQueenEndSecondNew % DateHelper.DAY_SECONDS) ;

        List<Integer> list = StringUtils.stringToIntegerList(GameConfig.NEWMONOPOLYMARKET_MAP_PARAM, "\\|");
        if(list.size() == 5){
            newMonopolyMapSize = list.get(0);
            newMonopolyMapBase = list.get(1);
            newMonopolyMapAdd = list.get(2);
            newMonopolyMapRound = list.get(3);
            newMonopolyMapMidValue = list.get(4);
        }

    }

    //初始化厢房配置
    private void initWingRoomConfig() {
        String[] weightParam = GameConfig.WINGROOM_FIND_FRIENDS_REFRESH_WEIGHT.split(",");
        shareEventRefreshBaseWeight = Integer.parseInt(weightParam[0]);
        shareEventRefreshAddWeight = Integer.parseInt(weightParam[1]);
        shareEventRefreshMaxWeight = Integer.parseInt(weightParam[2]);

        regionConfigMap = new HashMap<>();
        String[] regionsConfigArray = GameConfig.WINGROOM_AREA_DETAIL.split("\\|");
        for (String regionConfigArray : regionsConfigArray) {
            String[] regionConfigPar = regionConfigArray.split(",");
            int regionId = Integer.parseInt(regionConfigPar[0]);
            BaseRegionCoords regionCoords = RegionCoordsBuilder.createRegionCoords(regionId);
            if (regionCoords == null) {
                continue;
//                throw new RuntimeException("区域的坐标配置缺失, regionId:[" + regionId + "]" );
            }
            WingRoomRegionConfig regionConfig = WingRoomRegionConfig.WingRoomRegionConfigBuilder.aWingRoomRegionConfig()
                    .withRegionId(regionId)
                    .withPlaceType(Integer.parseInt(regionConfigPar[1]))
                    .withRegionBlockList(regionCoords.getRegionCoords())
                    .build();
            regionConfigMap.put(regionId, regionConfig);

            suitSkillMap = new HashMap<>();
            String[] suitSkillArray = GameConfig.WINGROOM_SUIT_SKILL_ID.split("\\|");
            for (String suitSkillParam : suitSkillArray) {
                String[] suitSkillParamArray = suitSkillParam.split(",");
                suitSkillMap.put(Integer.parseInt(suitSkillParamArray[0]), Integer.parseInt(suitSkillParamArray[1]));
            }
        }
    }

    private void initDrugStore(){
        drugHardCaseWeight = StringUtils.stringToIntegerList(GameConfig.DRUGSTORE_DIFFICULT_EVALUE_SCORE_WEIGHT,";");
        int tempDrugHardCaseTotalWeightValue = 0;
        for (int i = 0; i < drugHardCaseWeight.size(); i++) {
            tempDrugHardCaseTotalWeightValue += drugHardCaseWeight.get(i);
        }
        drugHardCaseTotalWeightValue = tempDrugHardCaseTotalWeightValue;
        drugHardCaseRewardList = StringUtils.stringToIntegerList(GameConfig.DRUGSTORE_DIFFICULT_REWARD,"\\|");
        drugHardCaseTimesList = StringUtils.stringToIntegerList(GameConfig.DRUGSTORE_DIFFICULT_EVALUE_REWARDLV,"\\|");
        drugHardCaseBuffValueList = StringUtils.stringToIntegerList(GameConfig.DRUGSTORE_DIFFICULT_EVALUE_BUFF,"\\|");
        List<String> healthEvaluationStrList = StringUtils.stringToStringList(GameConfig.DRUGSTORE_DIFFICULT_EVALUE,"\\|");

        List<Integer[]> tempHealthEvaluationList = new ArrayList<>();
        for (String healthEvaluationStr : healthEvaluationStrList){
            List<Integer> evaluationList = StringUtils.stringToIntegerList(healthEvaluationStr,";");
            Integer[] integers = new Integer[2];
            evaluationList.toArray(integers);
            tempHealthEvaluationList.add(integers);
        }
        healthEvaluationList = tempHealthEvaluationList;
    }


    public static int getPatronsUpgradeCost(int quality) {
        return patronsUpgradeCostList.get(quality - 1);
    }

    public static int getPatronsAbilityParam1() {
        return patronsAbilityParam1;
    }

    public static int getPatronsAbilityParam2() {
        return patronsAbilityParam2;
    }

    public static int getPatronsAbilityParam3() {
        return patronsAbilityParam3;
    }

    public static int getPatronsAbilityParam4() {
        return patronsAbilityParam4;
    }

    public static int getPatronsAbilityParam5() {
        return patronsAbilityParam5;
    }

    public static List<Integer> getVehicleSkillNormalModifyParamList() {
        return vehicleSkillNormalModifyParamList;
    }

    public static List<Integer> getVehicleSkillCustomModifyParamList() {
        return vehicleSkillCustomModifyParamList;
    }

    public static int getVehicleSkillModifySilverCostParam1() {
        return vehicleSkillModifySilverCostParam1;
    }

    public static int getVehicleSkillModifySilverCostParam2() {
        return vehicleSkillModifySilverCostParam2;
    }

    public static int getVehicleSkillModifySilverCostParam3() {
        return vehicleSkillModifySilverCostParam3;
    }

    public static int getVehicleSkillModifySilverCostParam4() {
        return vehicleSkillModifySilverCostParam4;
    }

    public static int getVehicleSkillModifyParam1() {
        return vehicleSkillModifyParam1;
    }

    public static int getVehicleSkillModifyParam2() {
        return vehicleSkillModifyParam2;
    }

    public static int getTradeWarBuyBuffCostParam1() {
        return tradeWarBuyBuffCostParam1;
    }

    public static int getTradeWarBuyBuffCostParam2() {
        return tradeWarBuyBuffCostParam2;
    }

    public static int getCrossTradeWarBuyBuffCostParam1() {
        return crossTradeWarBuyBuffCostParam1;
    }

    public static int getCrossTradeWarBuyBuffCostParam2() {
        return crossTradeWarBuyBuffCostParam2;
    }

    public static int getTradeWarRewardParam1() {
        return tradeWarRewardParam1;
    }

    public static int getTradeWarRewardParam2() {
        return tradeWarRewardParam2;
    }

    public static int getTradeWarRewardParam3() {
        return tradeWarRewardParam3;
    }

    public static int getCrossTradeWarRewardParam1() {
        return crossTradeWarRewardParam1;
    }

    public static int getCrossTradeWarRewardParam2() {
        return crossTradeWarRewardParam2;
    }

    public static int getCrossTradeWarRewardParam3() {
        return crossTradeWarRewardParam3;
    }

    public static int getBeautyAddExpParam1() {
        return beautyAddExpParam1;
    }

    public static int getBeautyAddExpParam2() {
        return beautyAddExpParam2;
    }

    public static int getBeautyAddExpParam3() {
        return beautyAddExpParam3;
    }

    public static int getBeautyTrystMakeChildParam1() {
        return beautyTrystMakeChildParam1;
    }

    public static int getBeautyTrystMakeChildParam2() {
        return beautyTrystMakeChildParam2;
    }

    public static int getBeautyTrystMakeChildParam3() {
        return beautyTrystMakeChildParam3;
    }

    public static int getBeautyTrystMakeChildParam4() {
        return beautyTrystMakeChildParam4;
    }

    public static int getBeautyTrystMakeChildParam5() {
        return beautyTrystMakeChildParam5;
    }

    public static int getBeautyTrystMakeChildParam6() {
        return beautyTrystMakeChildParam6;
    }

    public static List<Integer> getBeautySkillNormalModifyParamList() {
        return beautySkillNormalModifyParamList;
    }

    public static List<Integer> getBeautySkillCustomModifyParamList() {
        return beautySkillCustomModifyParamList;
    }

    public static int getBeautySkillModifySilverCostParam1() {
        return beautySkillModifySilverCostParam1;
    }

    public static int getBeautySkillModifySilverCostParam2() {
        return beautySkillModifySilverCostParam2;
    }

    public static int getBeautySkillModifySilverCostParam3() {
        return beautySkillModifySilverCostParam3;
    }

    public static int getBeautySkillModifySilverCostParam4() {
        return beautySkillModifySilverCostParam4;
    }

    public static int getTaskDailyActiveIndex(int taskActive) {
        if(null != taskDailyActiveList){
            int index = 0;
            for(int active : taskDailyActiveList){
                if(active == taskActive){
                    return index;
                }
                index++;
            }
        }
        return -1;
    }

    public static Property getTaskDailyActiveReward(int index) {
        if(null != taskDailyActiveRewardList) {
            if (taskDailyActiveRewardList.size() > index) {
                return taskDailyActiveRewardList.get(index);
            }
        }
        return null;
    }

    public static int getSevenDayActiveIndex(int taskActive) {
        if(null != sevenDayActiveList){
            int index = 0;
            for(int active : sevenDayActiveList){
                if(active == taskActive){
                    return index;
                }
                index++;
            }
        }
        return -1;
    }

    public static Property getSevenDayActiveReward(int index) {
        if(null != sevenDayActiveRewardList) {
            if (sevenDayActiveRewardList.size() > index) {
                return sevenDayActiveRewardList.get(index);
            }
        }
        return null;
    }

    public static boolean isSevenDayLimitMall(int mallId){
        return sevenDayLimitMallIdList.contains(Integer.valueOf(mallId));
    }

    public static int getSevenDayLimitMallIndex(int mallId){
        int index = sevenDayLimitMallIdList.size();
        for(int i = 0; i < sevenDayLimitMallIdList.size(); i++){
            if(sevenDayLimitMallIdList.get(i) == mallId){
                index = i;
                break;
            }
        }
        return index;
    }

    public static Map<Integer, Property> getSignRewardMap() {
        return signRewardMap;
    }

    public static Property getSignProperty(int signDays){
        return signRewardMap.get(signDays);
    }

    public static Map<Integer, Integer> getMineOpenNeedTitleMap() {
        return mineOpenNeedTitleMap;
    }

    public static int getMineOpenNeedTitle(int mineType){
        if(mineOpenNeedTitleMap.containsKey(mineType)){
            return mineOpenNeedTitleMap.get(mineType);
        }
        return 0;
    }

    public static Map<Integer, Integer> getMineOutputItemMap() {
        return mineOutputItemMap;
    }

    public static int getMineRefugeOutputAddition(int mineType){
        return mineRefugeOutputAdditionList.get(mineType - 1);
    }

    public static int getChildSiteUnlockCount(int title){
        int count = GameConfig.CHILDREN_DEFAULT_SITE_NUMBER;
        for(int i = childSiteCountUnlockParamList.size() - 1; i >= 0; i--){
            if(title >= childSiteCountUnlockParamList.get(i)){
                count += (i + 1);
                break;
            }
        }
        return count;
    }

    public static int getChildAdultRewardItemId(int occupation){
        return childAdultRewardItemIdList.get(occupation - 1);
    }

    public static int getRandomChildOccupation(int childCount){
        if(childCount < childRandomOccupationList.size()){
            return childRandomOccupationList.get(childCount);
        }
        return threadRandom.next(1, 6);
    }

    public static int getWorshipRewardIngots(){
        return threadRandom.next(worshipRewardParam1, worshipRewardParam2 + 1);
    }

    public static int getPassSilverBuyBuffCost(int times) {
        return passSilverBuyBuffCostList.get(times);
    }

    public static int getMaxPassSilverBuyBuffTimes() {
        return passSilverBuyBuffCostList.size();
    }

    public static Map<Integer, CardPrivilege> getCardPrivilegeMap() {
        return cardPrivilegeMap;
    }

    public static CardPrivilege getCardPrivilege(int cardType){
        return cardPrivilegeMap.get(cardType);
    }

    public static boolean isTurntableLotteryLucy(int lucyTimes){
        int randomValue = threadRandom.next(0, 1000000);
        int length = turntableLotteryPossibleList.size();
        int weight;
        if(lucyTimes < length){
            weight = turntableLotteryPossibleList.get(lucyTimes);
        }else {
            weight = turntableLotteryPossibleList.get(length - 1);
        }
        return weight > randomValue;
    }

    public static boolean hasUnionFlag(int unionFlag){
        return unionFlagList.contains(unionFlag);
    }

    public static int getUnionConstructActiveIndex(int constructActive) {
        if(null != unionConstructActiveList){
            int index = 0;
            for(int active : unionConstructActiveList){
                if(active == constructActive){
                    return index;
                }
                index++;
            }
        }
        return -1;
    }

    public static Property getUnionConstructActiveReward(int index) {
        if(null != unionConstructActiveRewardList) {
            if (unionConstructActiveRewardList.size() > index) {
                return unionConstructActiveRewardList.get(index);
            }
        }
        return null;
    }

    public static boolean isContributionEnough(long contribution, int position) {
        return positionNeedContributionMap.containsKey(position) && contribution >= positionNeedContributionMap.get(position);
    }

    public static int getEstateWarWorshipRewardParam1() {
        return estateWarWorshipRewardParam1;
    }

    public static int getEstateWarWorshipRewardParam2() {
        return estateWarWorshipRewardParam2;
    }

    public static int getEstateWarWorshipRewardParam3() {
        return estateWarWorshipRewardParam3;
    }

    public static HuntTimeData getHuntTimeData() {
        return huntTimeData;
    }

    public static List<HuntBoxReward> getHuntBoxRewardList() {
        return new ArrayList<>(huntBoxRewardList);
    }

    public static SacrificeTimeData getSacrificeTimeData() {
        return sacrificeTimeData;
    }

    public static List<Integer> getSacrificeAttackRewardParam() {
        return sacrificeAttackRewardParam;
    }

    public static List<Integer> getSacrificeBossLevelParam() {
        return sacrificeBossLevelParam;
    }

    public static List<SacrificeDamageRankReward> getSacrificeDamageRankRewardList() {
        return sacrificeDamageRankRewardList;
    }

    public static int getSacrificeDamageMaxRank() {
        return sacrificeDamageMaxRank;
    }

    public static String getLocationCity(String city){
        if(StringUtils.isNullOrEmpty(city)){
            return "";
        }
        String destCity = "";
        if(needTranslateLocationCity.contains(city)){
            if(randomLocationCity.size() > 0){
                int randomValue = threadRandom.next(0, randomLocationCity.size());
                destCity = randomLocationCity.get(randomValue);
            }
        }
        if(!StringUtils.isNullOrEmpty(destCity)){
            return destCity;
        }else {
            return city;
        }
    }

    public static boolean isNeedTranslateLocationCity(String city){
        return needTranslateLocationCity.contains(city);
    }

    public static boolean isNoTranslateCity(String city){
        if(StringUtils.isNullOrEmpty(city)){
            return true;
        }
        if(noTranslateCity.contains(city)){
            return true;
        }
        return false;
    }

    public static int getTravelMultiTimes() {
        return travelMultiTimes;
    }

    public static int getTravelMultiNeedTitle() {
        return travelMultiNeedTitle;
    }

    public static int getSkinMallPatronsNum() {
        return skinMallPatronsNum;
    }

    public static int getSkinMallBeautyNum() {
        return skinMallBeautyNum;
    }

    public static int getSkinMallAssistantNum() {
        return skinMallAssistantNum;
    }

    public static int getSkinMallAssistantUpdateDays() {
        return skinMallAssistantUpdateDays;
    }

    public static boolean isBrothelBeauty(int beautyId){
        return brothelBeautyList.contains(beautyId);
    }

    public static List<Integer> getBrothelBeautyList() {
        return brothelBeautyList;
    }

    public static int getFirstBrothelBeauty(){
        if(brothelBeautyList.size() > 0){
            return brothelBeautyList.get(0);
        }
        return 0;
    }

    public static BrothelInteractiveType getBrothelInteractiveType(int type){
        return brothelInteractiveTypeMap.get(type);
    }

    public static TravelDefaultEvent getTravelDefaultEvent(long travelTimes){
        int index;
        if(travelTimes >= Integer.MAX_VALUE){
            index = Integer.MAX_VALUE;
        }else {
            index = (int) travelTimes;
        }
        if(index >= 0 && index < travelDefaultEventList.size()){
            return travelDefaultEventList.get(index);
        }
        return null;
    }

    public static DrinkInteractiveType getRandomDrinkInteractiveType(){
        int randomValue = threadRandom.next(0, drinkInteractiveTotalWeight);
        int weight = 0;
        for(DrinkInteractiveType interactiveType : drinkInteractiveTypeList){
            weight += interactiveType.getWeight();
            if(weight >= randomValue){
                return interactiveType;
            }
        }
        return null;
    }

    public static boolean isCasinoType(int casinoType){
        return casinoInteractiveTypeMap.containsKey(casinoType);
    }

    public static CasinoInteractiveType getCasinoInteractiveType(int casinoType){
        return casinoInteractiveTypeMap.get(casinoType);
    }

    public static int getChildLonelyEarnSpeedTitleEffect1() {
        return childLonelyEarnSpeedTitleEffect1;
    }

    public static int getChildLonelyEarnSpeedTitleEffect2() {
        return childLonelyEarnSpeedTitleEffect2;
    }

    public static List<ChildGrowStageAddition> getChildGrowStageAdditionList() {
        return new ArrayList<>(childGrowStageAdditionList);
    }

    public static int getCrossTradeWarNoticeNeedKillPatronsCount(int joinServerCount){
        int size = crossTradeWarNoticeNeedKillPatronsCountList.size();
        int count = 0;
        for(int i = size - 1; i >= 0; i--){
            CrossTradeWarNoticeKillPatronsConfig config = crossTradeWarNoticeNeedKillPatronsCountList.get(i);
            count = config.getNeedKillPatronsCount();
            if(joinServerCount >= config.getServerCount()){
                return count;
            }
        }
        return count;
    }

    public static List<Integer> getDishesQualityScoreList() {
        return dishesQualityScoreList;
    }


    public static List<InnScore> getDishesScoreList() {
        return dishesScoreList;
    }

    public static int getDishesScoreRandomParam1() {
        return dishesScoreRandomParam1;
    }

    public static int getDishesScoreRandomParam2() {
        return dishesScoreRandomParam2;
    }

    public static List<ManagerReloadListener> getManagerReloadListenerList() {
        return managerReloadListenerList;
    }

    public static int getDishesLevelScoreParam1() {
        return dishesLevelScoreParam1;
    }

    public static int getDishesLevelScoreParam2() {
        return dishesLevelScoreParam2;
    }

    public static int getDishesLevelScoreParam3() {
        return dishesLevelScoreParam3;
    }

    public static List<Integer> getZsSkillList() {
        return zsSkillList;
    }

    public static List<Integer> getZsProjectOpenTime() {
        return zsProjectOpenTime;
    }

    public static List<Integer> getZsProjectOpenMultiple() {
        return zsProjectOpenMultiple;
    }

    public static List<MarriageConsume> initMarriageConsume(){
        List<MarriageConsume> dataList = new ArrayList<>();
        String[] configParam = GameConfig.CROSS_MARRIAGE_CONSUME_CONFIG.split("\\|");
        for(String consumeConfig : configParam){
            String[] configArr = consumeConfig.split(";");
            MarriageConsume data = new MarriageConsume();
            data.setEarnSpeed(new BigInteger(configArr[0]));
            data.setConsume(new Property(Integer.parseInt(configArr[1]), BigInteger.ONE));
            dataList.add(data);
        }
        return dataList;
    }

    /**
     * 获取联姻消耗
     * @param earnSpeed
     * @return
     */
    public static Property getMarriageConsume(BigInteger earnSpeed){
        int length = marriageConsumeList.size();
        for(int i = length - 1; i >= 0; i--){
            MarriageConsume marriageConsume = marriageConsumeList.get(i);
            if(earnSpeed.compareTo(marriageConsume.getEarnSpeed()) >= 0){
                return marriageConsume.getConsume();
            }
        }
        return null;
    }

    private static Map<Integer,Integer> initPassRoadEventNum(){
        Map<Integer,Integer> resMap = new ConcurrentHashMap<>();
        List<String> titleNumList = StringUtils.stringToStringList(GameConfig.PASS_ROAD_EVENT_NUM,"\\|");
        for(String titleNum: titleNumList){
            List<Integer> paramList = StringUtils.stringToIntegerList(titleNum,";");
            resMap.put(paramList.get(0),paramList.get(1));
        }
        return resMap;
    }

    private static Map<Integer, Property> initSystemPreviewRewardMap(){
        Map<Integer, Property> dataMap = new ConcurrentHashMap<>();
        String[] paramArr = GameConfig.ASSISTANT_YUGAO.split("\\|");
        for(String param : paramArr){
            String[] dataArr = param.split("#");
            if(dataArr.length > 1){
                int systemId = Integer.parseInt(dataArr[0]);
                Property reward = PropertyHelper.parseStringToProperty(dataArr[1]);
                dataMap.put(systemId, reward);
            }
        }
        return dataMap;
    }

    public static Integer getPassRoadEventNum(int titleId){
        int num = 0;
        for(int titleIdMin : passRoadEventNum.keySet()){
            if(titleId >= titleIdMin){
                if(passRoadEventNum.get(titleIdMin) > num){
                    num = passRoadEventNum.get(titleIdMin);
                }
            }
        }
        return num;
    }

    public static int getBrothelFreeType() {
        return brothelFreeType;
    }

    public static int getBestRewardCasinoInteractiveType() {
        return bestRewardCasinoInteractiveType;
    }


    public static List<Integer> getUnionConstructActiveList() {
        return unionConstructActiveList;
    }

    public static int getOfficeOpenSecond() {
        return officeOpenSecond;
    }

    public static int getOfficeEndSecond() {
        return officeEndSecond;
    }

    public static int getResGrabKingOpenSecond() {
        return resGrabKingOpenSecond;
    }

    public static int getResGrabKingEndSecond() {
        return resGrabKingEndSecond;
    }

    public static int getResGrabQueenOpenSecond() {
        return resGrabQueenOpenSecond;
    }

    public static int getResGrabQueenEndSecond() {
        return resGrabQueenEndSecond;
    }


    public static int getFortressDispatchPeriodOpenSecond() {
        return fortressDispatchPeriodOpenSecond;
    }


    public static int getFortressDispatchPeriodEndSecond() {
        return fortressDispatchPeriodEndSecond;
    }


    public static int getFortressSettlementPeriodOpenSecond() {
        return fortressSettlementPeriodOpenSecond;
    }


    public static int getFortressSettlementPeriodEndSecond() {
        return fortressSettlementPeriodEndSecond;
    }


    public static int getFortressCollectingPeriodOpenSecond() {
        return fortressCollectingPeriodOpenSecond;
    }


    public static int getFortressCollectingPeriodEndSecond() {
        return fortressCollectingPeriodEndSecond;
    }


    public static int getFortressRestPeriodEndSecond() {
        return fortressRestPeriodEndSecond;
    }


    public static MonopolyMarketConsume getOfficeConsume() {
        return officeConsume;
    }


    public static Map<Integer, MonopolyMarketConsume> getResGrabConsumeMap() {
        return resGrabConsumeMap;
    }


    public static Map<Integer, List<MonopolyMarketFortressRankReward>> getFortressRankRewardMap() {
        return fortressRankRewardMap;
    }

    public static int getKingDailyOpenTime() {
        return kingDailyOpenTime;
    }

    public static int getKingDailyEndTime() {
        return kingDailyEndTime;
    }

    public static int getQueenDailyOpenTime() {
        return queenDailyOpenTime;
    }

    public static int getQueenDailyEndTime() {
        return queenDailyEndTime;
    }
    public static int getBeautyTravelGuessSuccessReward() {
        return beautyTravelGuessSuccessReward;
    }

    public static int getBeautyTravelGuessFailReward() {
        return beautyTravelGuessFailReward;
    }

    public static int getBeautyTravelPoetrySuccessReward() {
        return beautyTravelPoetrySuccessReward;
    }

    public static int getBeautyTravelPoetryFailReward() {
        return beautyTravelPoetryFailReward;
    }


    public static int getGrandChildProfessionSkill(int occupation){
        if(occupation < 1 || occupation > 5){
            return 0;
        }
        if(occupation > grandChildProfessionSkillList.size()){
            return 0;
        }
        return grandChildProfessionSkillList.get(occupation - 1);
    }

    public static int getGrandChildProfessionId(int occupation){
        if(occupation < 1 || occupation > 5){
            return 0;
        }
        if(occupation > grandChildOccupationList.size()){
            return 0;
        }
        int maxValue = grandChildOccupationList.get(occupation - 1);
        int subOccupation = threadRandom.next(0, maxValue);
        int professionId = occupation * 10000 + subOccupation;
        return professionId;
    }

    public static int getOfficeOpenSecondNew() {
        return officeOpenSecondNew;
    }

    public static int getOfficeEndSecondNew() {
        return officeEndSecondNew;
    }

    public static int getResGrabKingOpenSecondNew() {
        return resGrabKingOpenSecondNew;
    }

    public static int getResGrabKingEndSecondNew() {
        return resGrabKingEndSecondNew;
    }

    public static int getResGrabQueenOpenSecondNew() {
        return resGrabQueenOpenSecondNew;
    }

    public static int getResGrabQueenEndSecondNew() {
        return resGrabQueenEndSecondNew;
    }

    public static int getKingDailyOpenTimeNew() {
        return kingDailyOpenTimeNew;
    }

    public static int getKingDailyEndTimeNew() {
        return kingDailyEndTimeNew;
    }

    public static int getQueenDailyOpenTimeNew() {
        return queenDailyOpenTimeNew;
    }

    public static int getQueenDailyEndTimeNew() {
        return queenDailyEndTimeNew;
    }

    public static int getNewMonopolyMapSize() {
        return newMonopolyMapSize;
    }

    public static int getNewMonopolyMapBase() {
        return newMonopolyMapBase;
    }

    public static int getNewMonopolyMapAdd() {
        return newMonopolyMapAdd;
    }

    public static int getNewMonopolyMapRound() {
        return newMonopolyMapRound;
    }

    public static int getNewMonopolyMapMidValue() {
        return newMonopolyMapMidValue;
    }

    public static int getNewMonopolyOpenRankTime() {
        return newMonopolyOpenRankTime;
    }

    public static int getNewMonopolyEndRankTime() {
        return newMonopolyEndRankTime;
    }

    public static MonopolyMarketConsume getOfficeConsumeNew() {
        return officeConsumeNew;
    }

    /**
    * 描述：根据府邸类型获取府邸原皮
    * 作者：zrq
    * 时间：2022/1/25
    * 参数：
    府邸类型
    * 返回值：府邸原皮
    **/
    public static int getEstateSkinId(int type){
        if(type < 0){
            return 0;
        }
        if(type > estateSkinList.size()){
            return 0;
        }
        return estateSkinList.get(type - 1);
    }

    public static int getShareEventRefreshBaseWeight() {
        return shareEventRefreshBaseWeight;
    }

    public static int getShareEventRefreshAddWeight() {
        return shareEventRefreshAddWeight;
    }

    public static int getShareEventRefreshMaxWeight() { return shareEventRefreshMaxWeight; }

    public static Map<Integer, WingRoomRegionConfig> getRegionConfigMap() {
        return regionConfigMap;
    }

    public static Map<Integer, Integer> getSuitSkillMap() {
        return suitSkillMap;
    }

    @Deprecated
    public static Property getSystemPreviewReward(int systemId){
        return systemPreviewRewardMap.get(systemId);
    }

    public static List<Integer> getDrugHardCaseWeight() {
        return drugHardCaseWeight;
    }

    public static List<Integer[]> getHealthEvaluationList() {
        return healthEvaluationList;
    }

    public static List<Integer> getDrugHardCaseTimesList() {
        return drugHardCaseTimesList;
    }

    public static List<Integer> getDrugHardCaseRewardList() {
        return drugHardCaseRewardList;
    }

    public static List<Integer> getDrugHardCaseBuffValueList() {
        return drugHardCaseBuffValueList;
    }

    public static int getDrugHardCaseTotalWeightValue() {
        return drugHardCaseTotalWeightValue;
    }


    private static Map<Integer, Property> initWineryFriendlyRewardMap(){
        Map<Integer, Property> dataMap = new ConcurrentHashMap<>();
        String[] paramArr = GameConfig.WINERY_FRIENDLY_REWARD.split("\\|");
        for(String param : paramArr){
            String[] dataArr = param.split("#");
            if(dataArr.length > 1){
                int friendlyValue = Integer.parseInt(dataArr[0]);
                Property reward = PropertyHelper.parseStringToProperty(dataArr[1]);
                dataMap.put(friendlyValue, reward);
            }
        }
        return dataMap;
    }

    private static List<WineryDrunkFriendlyConfig> initWineryDrunkFriendlyAddConfig() {
        ArrayList<WineryDrunkFriendlyConfig> list = new ArrayList<>();
        String[] strings = GameConfig.WINERY_DRUNK_FRIENDLY_ADD.split("\\|");
        for (String s : strings) {
            String[] split = s.split(";");
            WineryDrunkFriendlyConfig config = new WineryDrunkFriendlyConfig(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
            list.add(config);
        }
        return list;
    }


    private static int initWineryDispatchCoolDownTimeHour() {
        return GameConfig.WINERY_DISPATCH_COOL_DOWN_TIME;
    }

    private static int initWineryProcessWeightsFormula2() {
        return GameConfig.WINERY_PROCESS_WEIGHTS_FORMULA2;
    }

    private static Map<Integer, List<Integer>> initWineryDispatchSKillList() {
        Map<Integer, List<Integer>> listMap = new HashMap<>();
        String[] split1 = GameConfig.WINERY_DISPATCH_SKILL_LIST.split("\\|");
        for (String s1 : split1) {
            String[] split2 = s1.split("=");
            int wineryType = Integer.parseInt(split2[0]);

            if (!listMap.containsKey(wineryType)) {
                listMap.put(wineryType, new ArrayList<>());
            }
            String[] split3 = split2[1].split(";");
            for (String s3 : split3) {
                int skillId = Integer.parseInt(s3);
                listMap.get(wineryType).add(skillId);
            }
        }
        return listMap;
    }

    private static List<List<Integer>> initWineryProcessProbabilityFormulaList() {
        List<List<Integer>> arrayList = new ArrayList<>();
        String[] split1 = GameConfig.WINERY_PROCESS_PROBABILITY_FORMULA.split("\\|");
        for (String s1 : split1) {
            String[] split2 = s1.split(";");
            List<Integer> arrayList2 = new ArrayList<>();
            for (String s2 : split2) {
                Integer integer = Integer.valueOf(s2);
                arrayList2.add(integer);
            }
            arrayList.add(arrayList2);
        }
        return arrayList;
    }

    private static List<List<Integer>> initWineryProcessWeightsFormula1List() {
        List<List<Integer>> arrayList = new ArrayList<>();
        String[] split1 = GameConfig.WINERY_PROCESS_WEIGHTS_FORMULA1.split("\\|");
        for (String s1 : split1) {
            String[] split2 = s1.split(";");
            List<Integer> arrayList2 = new ArrayList<>();
            for (String s2 : split2) {
                Integer integer = Integer.valueOf(s2);
                arrayList2.add(integer);
            }
            arrayList.add(arrayList2);
        }
        return arrayList;
    }

    private static Property initWineryInitItemRewardMap(){
        Property reward = PropertyHelper.parseStringToProperty(GameConfig.WINERY_INIT_ITEM_REWARD);
        return reward;
    }

    private static List<List<Integer>> initWineryAbilityFormulaList() {
        List<List<Integer>> arrayList = new ArrayList<>();
        String[] split1 = GameConfig.WINERY_ABILITY_FORMULA.split("\\|");
        for (String s1 : split1) {
            String[] split2 = s1.split(";");
            List<Integer> arrayList2 = new ArrayList<>();
            for (String s2 : split2) {
                Integer integer = Integer.valueOf(s2);
                arrayList2.add(integer);
            }
            arrayList.add(arrayList2);
        }
        return arrayList;
    }

    private static List<ChatLimit> initChatLimitList(String configStr) {
        List<ChatLimit> dataList = new ArrayList<>();
        String[] configArr = configStr.split("\\|");
        for (String config : configArr) {
            String[] paramArr = config.split(";");
            ChatLimit data = new ChatLimit();
            data.setServerOpenDay(Integer.parseInt(paramArr[0]));
            data.setTitleLv(Integer.parseInt(paramArr[1]));
            dataList.add(data);
        }
        return dataList;
    }

    public static Map<Integer, Property> getWineryFriendlyRewardMap() {
        return wineryFriendlyRewardMap;
    }

    public static void setWineryFriendlyRewardMap(Map<Integer, Property> wineryFriendlyRewardMap) {
        ConfigMgr.wineryFriendlyRewardMap = wineryFriendlyRewardMap;
    }

    public static int getWineryDispatchCoolDownTimeHour() {
        return wineryDispatchCoolDownTimeHour;
    }

    public static void setWineryDispatchCoolDownTimeHour(int wineryDispatchCoolDownTimeHour) {
        ConfigMgr.wineryDispatchCoolDownTimeHour = wineryDispatchCoolDownTimeHour;
    }

    public static List<WineryDrunkFriendlyConfig> getWineryDrunkFriendlyConfigs() {
        return wineryDrunkFriendlyConfigs;
    }

    public static void setWineryDrunkFriendlyConfigs(List<WineryDrunkFriendlyConfig> wineryDrunkFriendlyConfigs) {
        ConfigMgr.wineryDrunkFriendlyConfigs = wineryDrunkFriendlyConfigs;
    }

    public static Map<Integer, List<Integer>> getWineryDispatchStaffSkillListMap() {
        return wineryDispatchStaffSkillListMap;
    }

    public static void setWineryDispatchStaffSkillListMap(Map<Integer, List<Integer>> wineryDispatchStaffSkillListMap) {
        ConfigMgr.wineryDispatchStaffSkillListMap = wineryDispatchStaffSkillListMap;
    }

    public static List<List<Integer>> getWineryProcessProbabilityFormula() {
        return wineryProcessProbabilityFormula;
    }

    public static List<List<Integer>> getWineryProcessWeightFormula1List() {
        return wineryProcessWeightFormula1List;
    }

    public static void setWineryProcessWeightFormula1List(List<List<Integer>> wineryProcessWeightFormula1List) {
        ConfigMgr.wineryProcessWeightFormula1List = wineryProcessWeightFormula1List;
    }

    public static int getWineryProcessWeightsFormula2() {
        return wineryProcessWeightsFormula2;
    }

    public static void setWineryProcessWeightsFormula2(int wineryProcessWeightsFormula2) {
        ConfigMgr.wineryProcessWeightsFormula2 = wineryProcessWeightsFormula2;
    }

    public static Property getWineryInitItemReward() {
        return wineryInitItemReward;
    }

    public static void setWineryInitItemReward(Property wineryInitItemReward) {
        ConfigMgr.wineryInitItemReward = wineryInitItemReward;
    }

    public static List<List<Integer>> getWineryAbilityFormulaList() {
        return wineryAbilityFormulaList;
    }

    public static int getWineryDispatchSkillUpgrade() {
        return wineryDispatchSkillUpgrade;
    }

    public static int getChatLimitTitleLv(int severOpenDay, boolean isCrossChat){
        List<ChatLimit> dataList;
        if(isCrossChat){
            dataList = crossChatLimitList;
        }else {
            dataList = localChatLimitList;
        }
        for(int i = dataList.size() - 1; i >= 0; i--){
            ChatLimit data = dataList.get(i);
            if(severOpenDay >= data.getServerOpenDay()){
                return data.getTitleLv();
            }
        }
        return 0;
    }

    public static int getTradeWarTrackTimesByVip(int vipLv){
        if(vipLv <=0){
            vipLv = 0;
        }
        int length = tradeWarTrackTimesByVipList.size();
        if(length <= 0){
            return 0;
        }
        if(vipLv >= length){
            vipLv = length - 1;
        }
        return tradeWarTrackTimesByVipList.get(vipLv);
    }

    public static Map<Integer, EscortDartTypeInfo> getDartTypeInfoMap() {
        return dartTypeInfoMap;
    }

    public static List<Integer> getRobberLoss() {
        return robberLoss;
    }

    /**
     * 获取镖车npc
     */
    public static EscortBeautyCartNPCInfo getEscortBeautyCartNPCInfo(int id){
        return cartNPCInfoMap.get(id);
    }

    /**
     * 随机n个镖车npc
     */
    public static List<EscortBeautyCartNPCInfo> randomCartNPC(int n, List<Integer> exclude) {
        List<Integer> idList = new ArrayList<>();
        List<EscortBeautyCartNPCInfo> result = new ArrayList<>();
        for(int id : cartNPCInfoMap.keySet()) {
            if(exclude.contains(id)){
                continue;
            }
            idList.add(id);
            result.add(cartNPCInfoMap.get(id));
        }
        if(result.size() <= n){
            return result;
        }
        result.clear();
        Random random = new Random();
        int i = 0;
        while(i < n && idList.size() > 0){
            List<Integer> weight = new ArrayList<>();
            for(int id : idList){
                weight.add(cartNPCInfoMap.get(id).getWeight());
            }
            int idx = RandomHelper.getRandomIndexByWeight(weight, random);
            result.add(cartNPCInfoMap.get(idList.get(idx)));
            idList.remove(idx);
            i++;
        }
        return result;
    }

    /**
     * 获取被劫损失千分比
     */
    public static BigDecimal getRobbedLossRatio(){
        return BigDecimal.valueOf(robberLoss.get(0)).divide(BigDecimal.valueOf(1000), 3, BigDecimal.ROUND_UP);
    }


    /**
     * 是否在开放走镖时间内
     */
    public static boolean isEscortTimeInDay(){
        long zeroSecond = DateHelper.getTodayZeroTimeStamp() / 1000;
        long nowSecond = DateHelper.getCurrentSecond() - zeroSecond;
        return nowSecond >= ESCORTING_START_MINUTE  * 60 && nowSecond <= ESCORTING_END_MINUTE * 60;
    }

    public static EscortDartTypeInfo getRobotDartCartType() {
        return robotDartCartType;
    }

    public static int getMaxRobTimesInLoss() {
        return MAX_ROB_TIMES_IN_LOSS;
    }

    public static List<Integer> getEscortEventProbability() {
        return ESCORT_EVENT_PROBABILITY;
    }

    public static int getEscortingEndMinute() {
        return ESCORTING_END_MINUTE;
    }

    public static int getFightRecoverConsume(int buyTimes){
        int need = fightBuyConsume.get(0) + (buyTimes - 1) * fightBuyConsume.get(1);
        if(need > fightBuyConsume.get(2)){
            return fightBuyConsume.get(2);
        }
        return need;
    }

    public static int getEscortRecoverConsume(int buyTimes){
        int need = escortBuyConsume.get(0) + (buyTimes - 1) * escortBuyConsume.get(1);
        if(need > escortBuyConsume.get(2)){
            return escortBuyConsume.get(2);
        }
        return need;
    }

    /**
     * 获取榜单最大长度
     */
    public static int getMaxRankNum(){
        int max = 0;
        for (EscortWeekRewardInfo rewardInfo : rankRewardList) {
            if(rewardInfo.getMax() > max){
                max = rewardInfo.getMax();
            }
        }
        return max;
    }

    /**
     * 获取榜单奖励
     */
    public static EscortWeekRewardInfo getRankReward(int rank){
        for (EscortWeekRewardInfo rewardInfo : rankRewardList) {
            if(rank >= rewardInfo.getMin() && rank <= rewardInfo.getMax()){
                return rewardInfo;
            }
        }
        if(rank == -1){
            return null;
        }
        return getRankReward(-1);
    }

    /**
     * 获取榜单奖励(会长奖励)
     */
    public static EscortWeekRewardInfo getRankChairReward(int rank){
        for (EscortWeekRewardInfo rewardInfo : rankChairRewardList) {
            if(rank >= rewardInfo.getMin() && rank <= rewardInfo.getMax()){
                return rewardInfo;
            }
        }
        if(rank == -1){
            return null;
        }
        return getRankChairReward(-1);
    }

    /**
     * （跨服）获取榜单奖励
     */
    public static EscortWeekRewardInfo getCrossRankReward(int rank){
        for (EscortWeekRewardInfo rewardInfo : rankCrossRewardList) {
            if(rank >= rewardInfo.getMin() && rank <= rewardInfo.getMax()){
                return rewardInfo;
            }
        }
        if(rank == -1){
            return null;
        }
        return getCrossRankReward(-1);
    }

    /**
     * （跨服）获取榜单奖励(会长奖励)
     */
    public static EscortWeekRewardInfo getCrossRankChairReward(int rank){
        for (EscortWeekRewardInfo rewardInfo : rankCrossChairRewardList) {
            if (rank >= rewardInfo.getMin() && rank <= rewardInfo.getMax()) {
                return rewardInfo;
            }
        }
        if (rank == -1) {
            return null;
        }
        return getCrossRankChairReward(-1);
    }

    public static RandomHelper getThreadRandom() {
        return threadRandom;
    }

    public static int getWeekCardExperimentTimes() {
        return weekCardExperimentTimes;
    }

    public static int getWeekCardExperimentDay() {
        return weekCardExperimentDay;
    }

    /**
     * 根据分组内的区服数和玩家实力排名得到评定等级,按占比来取
     */
    public static int getMonthAbilityRankToGrade(BigInteger value, int rank, int rankMax, Map<Integer, BigInteger> minValueMap) {
        if (rank <= 0) {
            //不在榜单上的，没有档次
            return 0;
        }
        if (rank >= rankMax) {//超过分母，最后一档
            return monthAbilityRankGradeConfigs.get(monthAbilityRankGradeConfigs.size() - 1).getGrade() + 1;
        }
        BigInteger beSureGradeFirstValue = minValueMap.getOrDefault(0, BigInteger.ZERO);
        if (!beSureGradeFirstValue.equals(BigInteger.ZERO) && value.compareTo(beSureGradeFirstValue) >= 0) {
            return 1;
        }
        RankGradeInfo result = null;
        int rankPercent = BigDecimal.valueOf(rank).divide(BigDecimal.valueOf(rankMax), 8, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(1000)).intValue();
        for (RankGradeInfo rankGradeInfo : monthAbilityRankGradeConfigs) {
            if (0 <= rankPercent && rankPercent <= rankGradeInfo.getEndRankPercent()) {
                BigInteger minValue = minValueMap.get(rankGradeInfo.getGrade());
                if (null == minValue || minValue.compareTo(value) <= 0) {
                    result = rankGradeInfo;
                    break;
                } else {
                    getLogger().info("排名{},分母{},赚钱{},没超过档次{}的最小赚钱{},降档", rank, rankMax, value.toString(), rankGradeInfo.getGrade(), minValue.toString());
                }
            }
        }
        if (null == result) {//没有满足条件的最后一档
            return monthAbilityRankGradeConfigs.get(monthAbilityRankGradeConfigs.size() - 1).getGrade() + 1;
        }
        return result.getGrade();
    }

    public static List<RankGradeInfo> getMonthAbilityRankGradeConfigs() {
        return monthAbilityRankGradeConfigs;
    }

    /**
     * 最后一档
     */
    public static int getLastMonthAbilityRankGrade() {
        return monthAbilityRankGradeConfigs.get(monthAbilityRankGradeConfigs.size() - 1).getGrade() + 1;
    }

    public static int getCrossUnionJoinNumLimitByAbilityGrade(int rankGrade) {
        return crossUnionJoinExConfig.getGradeLimitNum(rankGrade);
    }

    public static Map<Integer, Integer> getCrossUnionJoinNumLimitByAbilityGrade() {
        Map<Integer, Integer> gradeLimitMap = new ConcurrentHashMap<>(crossUnionJoinExConfig.getGradeNumLimitMap());
        return gradeLimitMap;
    }

    /**
     * 美女合并
     */
    public static boolean isBeautySetOne(int beautyId){
        List<String> list = StringUtils.stringToStringList(GameConfig.BEAUTY_SET_ONE_ID, "\\|");
        for (String set : list) {
            List<Integer> idList = StringUtils.stringToIntegerList(set, ";");
            if(idList.contains(beautyId)){
                return true;
            }
        }
        return false;
    }

    public static boolean isZhenHuan20() {
        boolean zhenHuan20 = false;
        ServerInfo serverInfo = ServerListMgr.getServerInfo(ConfigHelper.getLong("serverId"));
        if(serverInfo != null){
            zhenHuan20 = serverInfo.getSpecialServer() == eSpecialServerType.ZhenHuan.getValue();
        }
        return zhenHuan20;
    }

    public static boolean isTargetSpecialServer(eSpecialServerType serverType) {
        boolean zhenHuan20 = false;
        ServerInfo serverInfo = ServerListMgr.getServerInfo(ConfigHelper.getLong("serverId"));
        if(serverInfo != null){
            return  serverInfo.getSpecialServer() == serverType.getValue();
        }else {
            return false;
        }
    }
    public static boolean parsePatronsSakeConfig() {
        //门客信物
        List<String> tempParamList = StringUtils.stringToStringList(GameConfig.KEEPSAKE_PARAM, "#");
        if(tempParamList.size() != 2){
            getLogger().error("门客信物伴生技能配置异常");
            return true;
        }
        Map<Integer, Integer> paramOneMap = new HashMap<>();
        List<String> oneList = StringUtils.stringToStringList(tempParamList.get(0), ";");
        for (String str : oneList) {
            List<Integer> list = StringUtils.stringToIntegerList(str, "=");
            paramOneMap.put(list.get(0), list.get(1));
        }
        sakeLvToNumMap = paramOneMap;

        Map<Integer, Integer> paramTwoMap = new HashMap<>();
        List<String> twoList = StringUtils.stringToStringList(tempParamList.get(1), ";");
        for (String str : twoList) {
            List<Integer> list = StringUtils.stringToIntegerList(str, "=");
            paramTwoMap.put(list.get(0), list.get(1));
        }
        sakeLvToUnlockSkillMap = paramTwoMap;


        Map<Integer, Map<Integer, Integer>> companionParamMap = new HashMap<>();
        List<String> threeList = StringUtils.stringToStringList(GameConfig.KEEPSAKE_COMPANION_PARAM, "#");
        for (String str : threeList) {
            List<String> stringList = StringUtils.stringToStringList(str, "\\|");
            if(stringList.size() != 2){
                getLogger().error("门客信物伴生技能配置异常");
                return true;
            }
            int skillId = Integer.parseInt(stringList.get(0));
            List<String> strings = StringUtils.stringToStringList(stringList.get(1), ";");
            Map<Integer, Integer> map = new HashMap<>();
            for (String string : strings) {
                List<Integer> list = StringUtils.stringToIntegerList(string, "=");
                if(list.size() != 2){
                    getLogger().error("门客信物伴生技能配置异常");
                    return true;
                }
                map.put(list.get(0), list.get(1));
            }
            companionParamMap.put(skillId, map);
        }

        sakeCompanionParamMap = companionParamMap;
        return false;
    }

    public static Map<Integer, Map<Integer, Integer>> getSakeCompanionParamMap() {
        return sakeCompanionParamMap;
    }

    /**
     * 根据门客信物技能等级获得被绑定次数
     */
    public static int getPatronSakeBindNum(int sakeLv){
        int num = 1;
        for (Map.Entry<Integer, Integer> entry : sakeLvToNumMap.entrySet()) {
            if(sakeLv >= entry.getKey() && entry.getValue() > num){
                num = entry.getValue();
            }
        }
        return num;
    }

    /**
     * 根据门客信物技能等级获得解锁的伴生技能
     */
    public static List<Integer> getPatronsSakeUnlockSkillList(int sakeLv){
        List<Integer> skillList = new ArrayList<>();
        for (Map.Entry<Integer, Integer> entry : sakeLvToUnlockSkillMap.entrySet()) {
            if(sakeLv >= entry.getKey()){
                skillList.add(entry.getValue());
            }
        }
        return skillList;
    }

    /**
     *
     * @param skillId  要升级的技能
     * @param sakeSkillLv  类型为198技能的等级
     * @return
     */
    public static int getPatronsCompanionSkillLvLimit(int skillId, int sakeSkillLv, int defaultMaxLimit){
        if(!sakeCompanionParamMap.containsKey(skillId)){
            return defaultMaxLimit;
        }
        int mx = 0;
        Map<Integer, Integer> map = sakeCompanionParamMap.get(skillId);
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if(sakeSkillLv >= entry.getKey() && entry.getValue() > mx){
                mx = entry.getValue();
            }
        }
        if(defaultMaxLimit == 0){
            return mx;
        }
        return Math.min(defaultMaxLimit, mx);
    }


    public static UnionCampWarConfig getUnionCampWarConfig(){
        return unionCampWarConfig;
    }
    public static int getLinLeeSkinReplaceType() {
        return linLeeSkinReplaceType;
    }

    public static int getLinLeeSkinReplaceId() {
        return linLeeSkinReplaceId;
    }

    public static List<Integer> getTaskDailyActiveList() {
        return taskDailyActiveList;
    }
}
